]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
util: print expected uid/gid in UTI_CheckDirPermissions()
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 9 Sep 2015 15:05:51 +0000 (17:05 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 9 Sep 2015 15:19:07 +0000 (17:19 +0200)
util.c

diff --git a/util.c b/util.c
index f826d891864b07fa97e6723af265d717e369f8b2..247037cac3802676351c593e5468abed20d65aee 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1058,8 +1058,13 @@ UTI_CheckDirPermissions(const char *path, mode_t perm, uid_t uid, gid_t gid)
     return 0;
   }
 
-  if (buf.st_uid != uid || buf.st_gid != gid) {
-    LOG(LOGS_ERR, LOGF_Util, "Wrong owner/group of %s", path);
+  if (buf.st_uid != uid) {
+    LOG(LOGS_ERR, LOGF_Util, "Wrong owner of %s (%s != %d)", path, "UID", uid);
+    return 0;
+  }
+
+  if (buf.st_gid != gid) {
+    LOG(LOGS_ERR, LOGF_Util, "Wrong owner of %s (%s != %d)", path, "GID", gid);
     return 0;
   }