From d84a706c08a49440def9b02816719f08dbac4e13 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 11 Nov 2016 13:07:28 +0100 Subject: [PATCH] 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. --- conf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/conf.c b/conf.c index c255c24..d63b683 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); } /* ================================================== */