Check if the specified command bit is set for the specified user. * The function returns 1 is the bit is set or 0 if it is not. * Note that this function does not check the ALLCOMMANDS flag of the user * but just the lowlevel bitmask. * * If the bit overflows the user internal representation, zero is returned * in order to disallow the execution of the command in such edge case. */
| 386 | * If the bit overflows the user internal representation, zero is returned |
| 387 | * in order to disallow the execution of the command in such edge case. */ |
| 388 | int ACLGetUserCommandBit(user *u, unsigned long id) { |
| 389 | uint64_t word, bit; |
| 390 | if (ACLGetCommandBitCoordinates(id,&word,&bit) == C_ERR) return 0; |
| 391 | return (u->allowed_commands[word] & bit) != 0; |
| 392 | } |
| 393 | |
| 394 | /* When +@all or allcommands is given, we set a reserved bit as well that we |
| 395 | * can later test, to see if the user has the right to execute "future commands", |
no test coverage detected