mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 10:05:08 -05:00
util: don't try to create current directory
This prevents error messages when running chronyd -d/-q/-Q with default logdir in a directory chronyd is not allowed do access after dropping the root privileges.
This commit is contained in:
4
util.c
4
util.c
@@ -931,6 +931,10 @@ UTI_CreateDirAndParents(const char *path)
|
|||||||
char *p;
|
char *p;
|
||||||
int i, j, k, last;
|
int i, j, k, last;
|
||||||
|
|
||||||
|
/* Don't try to create current directory */
|
||||||
|
if (!strcmp(path, "."))
|
||||||
|
return 1;
|
||||||
|
|
||||||
p = (char *)Malloc(1 + strlen(path));
|
p = (char *)Malloc(1 + strlen(path));
|
||||||
|
|
||||||
i = k = 0;
|
i = k = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user