[systemd-devel] [PATCH] tmpfiles: Fail verbosely if acls can't be read
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Tue Mar 3 09:17:52 PST 2015
On Tue, Mar 03, 2015 at 12:35:08AM +0100, Hans-Peter Deifel wrote:
> 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.
Hi,
I solved this in a slightly different way. We do want to warn when getting
the acls fails, but when it is unsupported by the filesystem, log_debug is
enough. People are free to compile systemd with ACL support, and then use
it on a filesystem mounted without. If this confuses people, we could add
a once-per-mount-point warning about ACL not being supported on that fs.
Zbyszek
> ---
> 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
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
More information about the systemd-devel
mailing list