summaryrefslogtreecommitdiff
path: root/src/acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/acl.c')
-rw-r--r--src/acl.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/acl.c b/src/acl.c
index e120b36fc..445409ecd 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -1054,7 +1054,6 @@ void ACLInit(void) {
UsersToLoad = listCreate();
ACLLog = listCreate();
ACLInitDefaultUser();
- server.requirepass = NULL; /* Only used for backward compatibility. */
}
/* Check the username and password pair and return C_OK if they are valid,
@@ -2251,3 +2250,15 @@ void authCommand(client *c) {
}
}
+/* Set the password for the "default" ACL user. This implements supports for
+ * requirepass config, so passing in NULL will set the user to be nopass. */
+void ACLUpdateDefaultUserPassword(sds password) {
+ ACLSetUser(DefaultUser,"resetpass",-1);
+ if (password) {
+ sds aclop = sdscatlen(sdsnew(">"), password, sdslen(password));
+ ACLSetUser(DefaultUser,aclop,sdslen(aclop));
+ sdsfree(aclop);
+ } else {
+ ACLSetUser(DefaultUser,"nopass",-1);
+ }
+}