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. */
| 377 | * If the bit overflows the user internal representation, zero is returned |
| 378 | * in order to disallow the execution of the command in such edge case. */ |
| 379 | int ACLGetUserCommandBit(user *u, unsigned long id) { |
| 380 | uint64_t word, bit; |
| 381 | if (ACLGetCommandBitCoordinates(id,&word,&bit) == C_ERR) return 0; |
| 382 | return (u->allowed_commands[word] & bit) != 0; |
| 383 | } |
| 384 | |
| 385 | /* When +@all or allcommands is given, we set a reserved bit as well that we |
| 386 | * can later test, to see if the user has the right to execute "future commands", |
no test coverage detected