mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
ACL: better error reporting in users configuration errors.
This commit is contained in:
parent
b166c41edd
commit
68fd4a97fa
@ -794,7 +794,11 @@ void loadServerConfigFromString(char *config) {
|
|||||||
} else if (!strcasecmp(argv[0],"user") && argc >= 2) {
|
} else if (!strcasecmp(argv[0],"user") && argc >= 2) {
|
||||||
int argc_err;
|
int argc_err;
|
||||||
if (ACLAppendUserForLoading(argv,argc,&argc_err) == C_ERR) {
|
if (ACLAppendUserForLoading(argv,argc,&argc_err) == C_ERR) {
|
||||||
err = "Syntax error in user declaration";
|
char buf[1024];
|
||||||
|
char *errmsg = ACLSetUserStringError();
|
||||||
|
snprintf(buf,sizeof(buf),"Error in user declaration '%s': %s",
|
||||||
|
argv[argc_err],errmsg);
|
||||||
|
err = buf;
|
||||||
goto loaderr;
|
goto loaderr;
|
||||||
}
|
}
|
||||||
} else if (!strcasecmp(argv[0],"loadmodule") && argc >= 2) {
|
} else if (!strcasecmp(argv[0],"loadmodule") && argc >= 2) {
|
||||||
|
@ -1739,6 +1739,7 @@ int ACLSetUser(user *u, const char *op, ssize_t oplen);
|
|||||||
sds ACLDefaultUserFirstPassword(void);
|
sds ACLDefaultUserFirstPassword(void);
|
||||||
uint64_t ACLGetCommandCategoryFlagByName(const char *name);
|
uint64_t ACLGetCommandCategoryFlagByName(const char *name);
|
||||||
int ACLAppendUserForLoading(sds *argv, int argc, int *argc_err);
|
int ACLAppendUserForLoading(sds *argv, int argc, int *argc_err);
|
||||||
|
char *ACLSetUserStringError(void);
|
||||||
|
|
||||||
/* Sorted sets data type */
|
/* Sorted sets data type */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user