summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2019-01-18 11:26:29 +0100
committerantirez <antirez@gmail.com>2019-01-18 11:26:32 +0100
commitac6e49de4884eb1c2508179b903b0dfadde0f0b9 (patch)
tree54b9e074531bcd0e8e2fd0590509c85315900557
parent2c66c525f93539dab5e4fb71327fda2a9672cf3b (diff)
downloadredis-ac6e49de4884eb1c2508179b903b0dfadde0f0b9.tar.gz
ACL: implement resetpass directive and adjust test.
-rw-r--r--src/acl.c3
-rw-r--r--tests/unit/dump.tcl2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/acl.c b/src/acl.c
index aeda9f2f0..fc1edd875 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -190,6 +190,9 @@ int ACLSetUser(user *u, const char *op, ssize_t oplen) {
} else if (!strcasecmp(op,"nopass")) {
u->flags |= USER_FLAG_NOPASS;
listEmpty(u->passwords);
+ } else if (!strcasecmp(op,"resetpass")) {
+ u->flags &= ~USER_FLAG_NOPASS;
+ listEmpty(u->passwords);
} else if (op[0] == '>') {
sds newpass = sdsnewlen(op+1,oplen-1);
listNode *ln = listSearchKey(u->passwords,newpass);
diff --git a/tests/unit/dump.tcl b/tests/unit/dump.tcl
index 09768b80e..062d803b5 100644
--- a/tests/unit/dump.tcl
+++ b/tests/unit/dump.tcl
@@ -362,7 +362,7 @@ start_server {tags {"dump"}} {
r -1 lpush list a b c d
$second config set requirepass foobar2
catch {r -1 migrate $second_host $second_port list 9 5000 AUTH foobar} err
- assert_match {*invalid password*} $err
+ assert_match {*WRONGPASS*} $err
}
}
}