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.
This commit is contained in:
Miroslav Lichvar 2016-11-11 13:07:28 +01:00
parent ea58a1e72c
commit d84a706c08

10
conf.c
View file

@ -1268,11 +1268,6 @@ CNF_CreateDirs(uid_t uid, gid_t gid)
{ {
char *dir; 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 */ /* Create a directory for the Unix domain command socket */
if (bind_cmd_path[0]) { if (bind_cmd_path[0]) {
dir = UTI_PathToDir(bind_cmd_path); dir = UTI_PathToDir(bind_cmd_path);
@ -1288,6 +1283,11 @@ CNF_CreateDirs(uid_t uid, gid_t gid)
Free(dir); Free(dir);
} }
if (logdir[0])
UTI_CreateDirAndParents(logdir, 0755, uid, gid);
if (dumpdir[0])
UTI_CreateDirAndParents(dumpdir, 0755, uid, gid);
} }
/* ================================================== */ /* ================================================== */