diff options
author | Oran Agra <oran@redislabs.com> | 2021-02-01 20:11:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-01 20:11:42 +0200 |
commit | 2dba1e391d3772a8da182d95bde050ffa9d01e4d (patch) | |
tree | 3664bcd3ede605643a18668624f41c846b5e43ab /src/acl.c | |
parent | ec2d180739aa3877a45ec54438c68a7659be5159 (diff) | |
parent | 95338f9cc41fdfd050f122789187db75fda1fe3c (diff) | |
download | redis-6.2-rc3.tar.gz |
Merge 6.2 RC36.2-rc3
Diffstat (limited to 'src/acl.c')
-rw-r--r-- | src/acl.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1024,8 +1024,8 @@ int ACLSetUser(user *u, const char *op, ssize_t oplen) { /* Return a description of the error that occurred in ACLSetUser() according to * the errno value set by the function on error. */ -char *ACLSetUserStringError(void) { - char *errmsg = "Wrong format"; +const char *ACLSetUserStringError(void) { + const char *errmsg = "Wrong format"; if (errno == ENOENT) errmsg = "Unknown command or category name in ACL"; else if (errno == EINVAL) @@ -1454,7 +1454,7 @@ int ACLLoadConfiguredUsers(void) { /* Load every rule defined for this user. */ for (int j = 1; aclrules[j]; j++) { if (ACLSetUser(u,aclrules[j],sdslen(aclrules[j])) != C_OK) { - char *errmsg = ACLSetUserStringError(); + const char *errmsg = ACLSetUserStringError(); serverLog(LL_WARNING,"Error loading ACL rule '%s' for " "the user named '%s': %s", aclrules[j],aclrules[0],errmsg); @@ -1587,7 +1587,7 @@ sds ACLLoadFromFile(const char *filename) { for (j = 2; j < argc; j++) { argv[j] = sdstrim(argv[j],"\t\r\n"); if (ACLSetUser(fakeuser,argv[j],sdslen(argv[j])) != C_OK) { - char *errmsg = ACLSetUserStringError(); + const char *errmsg = ACLSetUserStringError(); errors = sdscatprintf(errors, "%s:%d: %s. ", server.acl_filename, linenum, errmsg); @@ -1908,7 +1908,7 @@ void aclCommand(client *c) { for (int j = 3; j < c->argc; j++) { if (ACLSetUser(tempu,c->argv[j]->ptr,sdslen(c->argv[j]->ptr)) != C_OK) { - char *errmsg = ACLSetUserStringError(); + const char *errmsg = ACLSetUserStringError(); addReplyErrorFormat(c, "Error in ACL SETUSER modifier '%s': %s", (char*)c->argv[j]->ptr, errmsg); |