From: Miroslav Lichvar Date: Wed, 5 Aug 2015 14:53:02 +0000 (+0200) Subject: util: don't try to create current directory X-Git-Tag: 2.2-pre1~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a83cab2f8423f1b7895b21495db2c274298d438;p=thirdparty%2Fchrony.git 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. --- diff --git a/util.c b/util.c index 82bb46a1..89379d9c 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;