[systemd-devel] [PATCH] tmpfiles: Fail verbosely if acls can't be read

Hans-Peter Deifel hpd at hpdeifel.de
Mon Mar 2 15:35:08 PST 2015


If the acls of a file couldn't be retrieved (probably due to missing acl
support in the filesytem), systemd-tmpfiles just silently failed.

Now it logs an error, just as it already does if the acls cannot be set.
---
 src/tmpfiles/tmpfiles.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 2642934..de8aa76 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -703,7 +703,9 @@ static int path_set_acl(const char *path, acl_type_t type, acl_t acl, bool modif
         if (modify) {
                 r = acls_for_file(path, type, acl, &dup);
                 if (r < 0)
-                        return r;
+                        return log_error_errno(r, "Getting %s ACL on %s failed: %m",
+                                               type == ACL_TYPE_ACCESS ? "access" : "default",
+                                               path);
 
                 r = calc_acl_mask_if_needed(&dup);
                 if (r < 0)
-- 
2.3.1



More information about the systemd-devel mailing list