From: Miroslav Lichvar Date: Fri, 11 Nov 2016 12:07:28 +0000 (+0100) Subject: conf: create socket directory before logdir and dumpdir X-Git-Tag: 3.0-pre1~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d84a706c08a49440def9b02816719f08dbac4e13;p=thirdparty%2Fchrony.git conf: create socket directory before logdir and dumpdir This allows sharing of the same directory for sockets, logs and dumps as the socket directory needs to be created first (with mode 0770) in order to pass the check of the permissions. --- diff --git a/conf.c b/conf.c index c255c24a..d63b6830 100644 --- a/conf.c +++ b/conf.c @@ -1268,11 +1268,6 @@ CNF_CreateDirs(uid_t uid, gid_t gid) { char *dir; - if (logdir[0]) - UTI_CreateDirAndParents(logdir, 0755, uid, gid); - if (dumpdir[0]) - UTI_CreateDirAndParents(dumpdir, 0755, uid, gid); - /* Create a directory for the Unix domain command socket */ if (bind_cmd_path[0]) { dir = UTI_PathToDir(bind_cmd_path); @@ -1288,6 +1283,11 @@ CNF_CreateDirs(uid_t uid, gid_t gid) Free(dir); } + + if (logdir[0]) + UTI_CreateDirAndParents(logdir, 0755, uid, gid); + if (dumpdir[0]) + UTI_CreateDirAndParents(dumpdir, 0755, uid, gid); } /* ================================================== */