• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / tarantool / 16469240759

23 Jul 2025 11:21AM UTC coverage: 87.577% (+0.02%) from 87.553%
16469240759

push

github

sergepetrenko
box: fix misleading errors on privilege revoke from admin

Trying to revoke privileges from an admin user or a super role results
in misleading errors:
```
error: 'Tuple field 5 (privilege) type does not match one required by operation:
    expected unsigned, got integer'
```

The reason is that privileges use bit module for privilege grant/revoke,
and this module operates 32-bit **signed** integers (see
https://bitop.luajit.org/semantics.html#range for details). So any bit
operation on a privilege set greater than 2^31 (for example,
box.priv.ALL == 2^32 - 1) results in a negative number:

```lua
tarantool> bit.band(box.priv.ALL, bit.bnot(box.priv.W))
---
- -3
...

```

Fortunately, this can be fixed by casting one of the operands to a
uint64_t type, so let's cast all granted or revoked privileges prior to
calculating the resulting privilege set.

Closes #11526

NO_DOC=bugfix

70700 of 124581 branches covered (56.75%)

103959 of 118706 relevant lines covered (87.58%)

1355767.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.2
/src/box/engine.c


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc