mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16: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:
12
logging.c
12
logging.c
@@ -299,18 +299,6 @@ LOG_FileWrite(LOG_FileID id, const char *format, ...)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
LOG_CreateLogFileDir(void)
|
||||
{
|
||||
const char *logdir;
|
||||
|
||||
logdir = CNF_GetLogDir();
|
||||
|
||||
UTI_CreateDirAndParents(logdir, 0755, 0, 0);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
LOG_CycleLogFiles(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user