Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
968cb266
Commit
968cb266
authored
Jan 26, 2018
by
zhaozhao.zz
Browse files
config: handle special configuration "" for auth
parent
4aa2ecd9
Changes
1
Show whitespace changes
Inline
Side-by-side
src/config.c
View file @
968cb266
...
@@ -390,7 +390,7 @@ void loadServerConfigFromString(char *config) {
...
@@ -390,7 +390,7 @@ void loadServerConfigFromString(char *config) {
}
}
} else if (!strcasecmp(argv[0],"masterauth") && argc == 2) {
} else if (!strcasecmp(argv[0],"masterauth") && argc == 2) {
zfree(server.masterauth);
zfree(server.masterauth);
server
.
masterauth
=
zstrdup
(
argv
[
1
]);
server.masterauth =
argv[1][0] ?
zstrdup(argv[1])
: NULL
;
} else if (!strcasecmp(argv[0],"slave-serve-stale-data") && argc == 2) {
} else if (!strcasecmp(argv[0],"slave-serve-stale-data") && argc == 2) {
if ((server.repl_serve_stale_data = yesnotoi(argv[1])) == -1) {
if ((server.repl_serve_stale_data = yesnotoi(argv[1])) == -1) {
err = "argument must be 'yes' or 'no'"; goto loaderr;
err = "argument must be 'yes' or 'no'"; goto loaderr;
...
@@ -496,7 +496,7 @@ void loadServerConfigFromString(char *config) {
...
@@ -496,7 +496,7 @@ void loadServerConfigFromString(char *config) {
err = "Password is longer than CONFIG_AUTHPASS_MAX_LEN";
err = "Password is longer than CONFIG_AUTHPASS_MAX_LEN";
goto loaderr;
goto loaderr;
}
}
server
.
requirepass
=
zstrdup
(
argv
[
1
]);
server.requirepass =
argv[1][0] ?
zstrdup(argv[1])
: NULL
;
} else if (!strcasecmp(argv[0],"pidfile") && argc == 2) {
} else if (!strcasecmp(argv[0],"pidfile") && argc == 2) {
zfree(server.pidfile);
zfree(server.pidfile);
server.pidfile = zstrdup(argv[1]);
server.pidfile = zstrdup(argv[1]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment