From 9a83cab2f8423f1b7895b21495db2c274298d438 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 5 Aug 2015 16:53:02 +0200 Subject: [PATCH] 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. --- util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util.c b/util.c index 82bb46a..89379d9 100644 --- a/util.c +++ b/util.c @@ -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;