From 924b86b700bd4c7ad4f7810f2f31092d2732ca01 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 18 Jun 2014 00:10:43 +1000 Subject: [PATCH] Create ckdb sockdir if it's not present and change permissions to 750 --- src/ckpool.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ckpool.c b/src/ckpool.c index b4513407..6116e5a2 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -881,13 +881,18 @@ int main(int argc, char **argv) realloc_strcat(&ckp.ckdb_sockdir, ckp.ckdb_name); } trail_slash(&ckp.ckdb_sockdir); + + ret = mkdir(ckp.ckdb_sockdir, 0750); + if (ret && errno != EEXIST) + quit(1, "Failed to make directory %s", ckp.ckdb_sockdir); + ckp.ckdb_sockname = ckp.ckdb_sockdir; realloc_strcat(&ckp.ckdb_sockdir, "listener"); /* Ignore sigpipe */ signal(SIGPIPE, SIG_IGN); - ret = mkdir(ckp.socket_dir, 0700); + ret = mkdir(ckp.socket_dir, 0750); if (ret && errno != EEXIST) quit(1, "Failed to make directory %s", ckp.socket_dir); @@ -927,7 +932,7 @@ int main(int argc, char **argv) /* Create the log directory */ trail_slash(&ckp.logdir); - ret = mkdir(ckp.logdir, 0700); + ret = mkdir(ckp.logdir, 0750); if (ret && errno != EEXIST) quit(1, "Failed to make log directory %s", ckp.logdir);