Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
c33cb493
Commit
c33cb493
authored
Mar 05, 2019
by
antirez
Browse files
ACL: GENPASS subcommand.
parent
4edb1d7e
Changes
1
Show whitespace changes
Inline
Side-by-side
src/acl.c
View file @
c33cb493
...
@@ -1389,6 +1389,8 @@ void ACLLoadUsersAtStartup(void) {
...
@@ -1389,6 +1389,8 @@ void ACLLoadUsersAtStartup(void) {
* ACL SETUSER <username> ... acl rules ...
* ACL SETUSER <username> ... acl rules ...
* ACL DELUSER <username> [...]
* ACL DELUSER <username> [...]
* ACL GETUSER <username>
* ACL GETUSER <username>
* ACL GENPASS
* ACL WHOAMI
*/
*/
void
aclCommand
(
client
*
c
)
{
void
aclCommand
(
client
*
c
)
{
char
*
sub
=
c
->
argv
[
1
]
->
ptr
;
char
*
sub
=
c
->
argv
[
1
]
->
ptr
;
...
@@ -1571,6 +1573,10 @@ void aclCommand(client *c) {
...
@@ -1571,6 +1573,10 @@ void aclCommand(client *c) {
}
}
dictReleaseIterator
(
di
);
dictReleaseIterator
(
di
);
setDeferredArrayLen
(
c
,
dl
,
arraylen
);
setDeferredArrayLen
(
c
,
dl
,
arraylen
);
}
else
if
(
!
strcasecmp
(
sub
,
"genpass"
)
&&
c
->
argc
==
2
)
{
char
pass
[
32
];
/* 128 bits of actual pseudo random data. */
getRandomHexChars
(
pass
,
sizeof
(
pass
));
addReplyBulkCBuffer
(
c
,
pass
,
sizeof
(
pass
));
}
else
if
(
!
strcasecmp
(
sub
,
"help"
))
{
}
else
if
(
!
strcasecmp
(
sub
,
"help"
))
{
const
char
*
help
[]
=
{
const
char
*
help
[]
=
{
"LOAD -- Reload users from the ACL file."
,
"LOAD -- Reload users from the ACL file."
,
...
@@ -1581,6 +1587,7 @@ void aclCommand(client *c) {
...
@@ -1581,6 +1587,7 @@ void aclCommand(client *c) {
"DELUSER <username> [...] -- Delete a list of users."
,
"DELUSER <username> [...] -- Delete a list of users."
,
"CAT -- List available categories."
,
"CAT -- List available categories."
,
"CAT <category> -- List commands inside category."
,
"CAT <category> -- List commands inside category."
,
"GENPASS -- Generate a secure user password."
,
"WHOAMI -- Return the current connection username."
,
"WHOAMI -- Return the current connection username."
,
NULL
NULL
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment