MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ACLResetSubcommands

Function ACLResetSubcommands

app/redis-6.2.6/src/acl.c:697–708  ·  view source on GitHub ↗

Flush the entire table of subcommands. This is useful on +@all, -@all * or similar to return back to the minimal memory usage (and checks to do) * for the user. */

Source from the content-addressed store, hash-verified

695 * or similar to return back to the minimal memory usage (and checks to do)
696 * for the user. */
697void ACLResetSubcommands(user *u) {
698 if (u->allowed_subcommands == NULL) return;
699 for (int j = 0; j < USER_COMMAND_BITS_COUNT; j++) {
700 if (u->allowed_subcommands[j]) {
701 for (int i = 0; u->allowed_subcommands[j][i]; i++)
702 sdsfree(u->allowed_subcommands[j][i]);
703 zfree(u->allowed_subcommands[j]);
704 }
705 }
706 zfree(u->allowed_subcommands);
707 u->allowed_subcommands = NULL;
708}
709
710/* Add a subcommand to the list of subcommands for the user 'u' and
711 * the command id specified. */

Callers 3

ACLFreeUserFunction · 0.85
ACLCopyUserFunction · 0.85
ACLSetUserFunction · 0.85

Calls 2

sdsfreeFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected