mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
ACL: implement resetpass directive and adjust test.
This commit is contained in:
parent
2c66c525f9
commit
ac6e49de48
@ -190,6 +190,9 @@ int ACLSetUser(user *u, const char *op, ssize_t oplen) {
|
|||||||
} else if (!strcasecmp(op,"nopass")) {
|
} else if (!strcasecmp(op,"nopass")) {
|
||||||
u->flags |= USER_FLAG_NOPASS;
|
u->flags |= USER_FLAG_NOPASS;
|
||||||
listEmpty(u->passwords);
|
listEmpty(u->passwords);
|
||||||
|
} else if (!strcasecmp(op,"resetpass")) {
|
||||||
|
u->flags &= ~USER_FLAG_NOPASS;
|
||||||
|
listEmpty(u->passwords);
|
||||||
} else if (op[0] == '>') {
|
} else if (op[0] == '>') {
|
||||||
sds newpass = sdsnewlen(op+1,oplen-1);
|
sds newpass = sdsnewlen(op+1,oplen-1);
|
||||||
listNode *ln = listSearchKey(u->passwords,newpass);
|
listNode *ln = listSearchKey(u->passwords,newpass);
|
||||||
|
@ -362,7 +362,7 @@ start_server {tags {"dump"}} {
|
|||||||
r -1 lpush list a b c d
|
r -1 lpush list a b c d
|
||||||
$second config set requirepass foobar2
|
$second config set requirepass foobar2
|
||||||
catch {r -1 migrate $second_host $second_port list 9 5000 AUTH foobar} err
|
catch {r -1 migrate $second_host $second_port list 9 5000 AUTH foobar} err
|
||||||
assert_match {*invalid password*} $err
|
assert_match {*WRONGPASS*} $err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user