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:
Miroslav Lichvar 2015-08-05 16:53:02 +02:00
parent 92706b158e
commit 9a83cab2f8

4
util.c
View file

@ -931,6 +931,10 @@ UTI_CreateDirAndParents(const char *path)
char *p;
int i, j, k, last;
/* Don't try to create current directory */
if (!strcmp(path, "."))
return 1;
p = (char *)Malloc(1 + strlen(path));
i = k = 0;