mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:35:06 -05:00
conf: create directories before dropping root
Create logdir and dumpdir before dropping root. Set their uid/gid to the user chronyd will switch to. This allows chronyd to create the directories in a directory where the user won't have write permissions (e.g. /var/lib).
This commit is contained in:
9
conf.c
9
conf.c
@@ -1258,6 +1258,15 @@ parse_include(char *line)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
CNF_CreateDirs(uid_t uid, gid_t gid)
|
||||
{
|
||||
UTI_CreateDirAndParents(logdir, 0755, uid, gid);
|
||||
UTI_CreateDirAndParents(dumpdir, 0755, uid, gid);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
CNF_AddInitSources(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user