mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 07:05:06 -05:00
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:
10
conf.c
10
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);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
Reference in New Issue
Block a user