MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / ACLResetSubcommands

Function ACLResetSubcommands

src/acl.cpp:706–717  ·  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

704 * or similar to return back to the minimal memory usage (and checks to do)
705 * for the user. */
706void ACLResetSubcommands(user *u) {
707 if (u->allowed_subcommands == NULL) return;
708 for (int j = 0; j < USER_COMMAND_BITS_COUNT; j++) {
709 if (u->allowed_subcommands[j]) {
710 for (int i = 0; u->allowed_subcommands[j][i]; i++)
711 sdsfree(u->allowed_subcommands[j][i]);
712 zfree(u->allowed_subcommands[j]);
713 }
714 }
715 zfree(u->allowed_subcommands);
716 u->allowed_subcommands = NULL;
717}
718
719/* Add a subcommand to the list of subcommands for the user 'u' and
720 * the command id specified. */

Callers 3

ACLFreeUserFunction · 0.85
ACLCopyUserFunction · 0.85
ACLSetUserFunction · 0.85

Calls 2

sdsfreeFunction · 0.85
zfreeFunction · 0.85

Tested by

no test coverage detected