summaryrefslogtreecommitdiff
path: root/src/acl.c
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2021-02-01 20:11:42 +0200
committerGitHub <noreply@github.com>2021-02-01 20:11:42 +0200
commit2dba1e391d3772a8da182d95bde050ffa9d01e4d (patch)
tree3664bcd3ede605643a18668624f41c846b5e43ab /src/acl.c
parentec2d180739aa3877a45ec54438c68a7659be5159 (diff)
parent95338f9cc41fdfd050f122789187db75fda1fe3c (diff)
downloadredis-6.2-rc3.tar.gz
Merge 6.2 RC36.2-rc3
Diffstat (limited to 'src/acl.c')
-rw-r--r--src/acl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/acl.c b/src/acl.c
index 14d023cc3..1f07c292f 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -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);