diff options
author | Itamar Haber <itamar@redislabs.com> | 2021-01-04 17:02:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-04 17:02:57 +0200 |
commit | 9dcdc7e79a25968fcdfde09c7ca72a2012a1febf (patch) | |
tree | ae614234406e8194e5263c5e6d1c96f826a31614 /src/acl.c | |
parent | 10f94b0ab12f9315939dcccf39d64b9388c0c7fa (diff) | |
download | redis-9dcdc7e79a25968fcdfde09c7ca72a2012a1febf.tar.gz |
HELP subcommand, continued (#5531)
* man-like consistent long formatting
* Uppercases commands, subcommands and options
* Adds 'HELP' to HELP for all
* Lexicographical order
* Uses value notation and other .md likeness
* Moves const char *help to top
* Keeps it under 80 chars
* Misc help typos, consistent conjuctioning (i.e return and not returns)
* Uses addReplySubcommandSyntaxError(c) all over
Signed-off-by: Itamar Haber <itamar@redislabs.com>
Diffstat (limited to 'src/acl.c')
-rw-r--r-- | src/acl.c | 44 |
1 files changed, 28 insertions, 16 deletions
@@ -174,15 +174,15 @@ sds ACLHashPassword(unsigned char *cleartext, size_t len) { return sdsnewlen(hex,HASH_PASSWORD_LEN); } -/* Given a hash and the hash length, returns C_OK if it is a valid password +/* Given a hash and the hash length, returns C_OK if it is a valid password * hash, or C_ERR otherwise. */ int ACLCheckPasswordHash(unsigned char *hash, int hashlen) { if (hashlen != HASH_PASSWORD_LEN) { - return C_ERR; + return C_ERR; } - + /* Password hashes can only be characters that represent - * hexadecimal values, which are numbers and lowercase + * hexadecimal values, which are numbers and lowercase * characters 'a' through 'f'. */ for(int i = 0; i < HASH_PASSWORD_LEN; i++) { char c = hash[i]; @@ -2184,18 +2184,30 @@ void aclCommand(client *c) { } } else if (c->argc == 2 && !strcasecmp(sub,"help")) { const char *help[] = { -"LOAD -- Reload users from the ACL file.", -"SAVE -- Save the current config to the ACL file.", -"LIST -- Show user details in config file format.", -"USERS -- List all the registered usernames.", -"SETUSER <username> [attribs ...] -- Create or modify a user.", -"GETUSER <username> -- Get the user details.", -"DELUSER <username> [...] -- Delete a list of users.", -"CAT -- List available categories.", -"CAT <category> -- List commands inside category.", -"GENPASS [<bits>] -- Generate a secure user password.", -"WHOAMI -- Return the current connection username.", -"LOG [<count> | RESET] -- Show the ACL log entries.", +"CAT [<category>]", +" List all commands that belong to <category>, or all command categories", +" when no category is specified.", +"DELUSER <username> [<username> ...]", +" Delete a list of users.", +"GETUSER <username>", +" Get the user's details.", +"GENPASS [<bits>]", +" Generate a secure 256-bit user password. The optional `bits` argument can", +" be used to specify a different size.", +"LIST", +" Show users details in config file format.", +"LOAD", +" Reload users from the ACL file.", +"LOG [<count> | RESET]", +" Show the ACL log entries.", +"SAVE", +" Save the current config to the ACL file.", +"SETUSER <username> <attribute> [<attribute> ...]", +" Create or modify a user with the specified attributes.", +"USERS", +" List all the registered usernames.", +"WHOAMI", +" Return the current connection username.", NULL }; addReplyHelp(c,help); |