]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: improve error message for chown()/chmod() failures (#4969)
authorLennart Poettering <lennart@poettering.net>
Thu, 29 Dec 2016 10:00:55 +0000 (11:00 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Thu, 29 Dec 2016 10:00:55 +0000 (11:00 +0100)
Let's make the error message less confusing here.

Fixes: #4954
src/tmpfiles/tmpfiles.c

index 79f75e165b46c1133ac967e66e60ff04d86e11ca..f4ce9791fbb7f988d5bb4c3de0cd7328317975b9 100644 (file)
@@ -649,7 +649,7 @@ static int path_set_perms(Item *i, const char *path) {
                         else {
                                 log_debug("chmod \"%s\" to mode %o", path, m);
                                 if (chmod(fn, m) < 0)
-                                        return log_error_errno(errno, "chmod(%s) failed: %m", path);
+                                        return log_error_errno(errno, "chmod() of %s via %s failed: %m", path, fn);
                         }
                 }
 
@@ -662,7 +662,7 @@ static int path_set_perms(Item *i, const char *path) {
                         if (chown(fn,
                                   i->uid_set ? i->uid : UID_INVALID,
                                   i->gid_set ? i->gid : GID_INVALID) < 0)
-                                return log_error_errno(errno, "chown(%s) failed: %m", path);
+                                return log_error_errno(errno, "chown() of %s via %s failed: %m", path, fn);
                 }
         }