Set the specified command bit for the specified user to 'value' (0 or 1). * If the bit overflows the user internal representation, no operation * is performed. As a side effect of calling this function with a value of * zero, the user flag ALLCOMMANDS is cleared since it is no longer possible * to skip the command bit explicit test. */
| 395 | * zero, the user flag ALLCOMMANDS is cleared since it is no longer possible |
| 396 | * to skip the command bit explicit test. */ |
| 397 | void ACLSetUserCommandBit(user *u, unsigned long id, int value) { |
| 398 | uint64_t word, bit; |
| 399 | if (ACLGetCommandBitCoordinates(id,&word,&bit) == C_ERR) return; |
| 400 | if (value) { |
| 401 | u->allowed_commands[word] |= bit; |
| 402 | } else { |
| 403 | u->allowed_commands[word] &= ~bit; |
| 404 | u->flags &= ~USER_FLAG_ALLCOMMANDS; |
| 405 | } |
| 406 | } |
| 407 | |
| 408 | /* This is like ACLSetUserCommandBit(), but instead of setting the specified |
| 409 | * ID, it will check all the commands in the category specified as argument, |
no test coverage detected