Added a config directive for a Unix socket mask

Added a configuration directive to allow a user to specify the
permissions to be granted to the Unix socket file.  I followed
the format Pieter and Salvatore discusses in issue #85 (
https://github.com/antirez/redis/issues/85).
This commit is contained in:
Nathan Florea
2011-10-10 11:21:15 -07:00
committed by antirez
parent 1ca8deebef
commit 09cefcfbb3
6 changed files with 14 additions and 3 deletions

View File

@ -74,6 +74,11 @@ void loadServerConfig(char *filename) {
server.bindaddr = zstrdup(argv[1]);
} else if (!strcasecmp(argv[0],"unixsocket") && argc == 2) {
server.unixsocket = zstrdup(argv[1]);
} else if (!strcasecmp(argv[0],"unixsocketperm") && argc == 2) {
server.unixsocketperm = (mode_t)strtol(argv[1], NULL, 8);
if (errno || server.unixsocketperm > 0777) {
err = "Invalid socket file permissions"; goto loaderr;
}
} else if (!strcasecmp(argv[0],"save") && argc == 3) {
int seconds = atoi(argv[1]);
int changes = atoi(argv[2]);