xfs
[Top] [All Lists]

Re: [PATCH 4/4] xfs: SGI ACLs: Prepare for richacls

To: Brian Foster <bfoster@xxxxxxxxxx>, xfs@xxxxxxxxxxx
Subject: Re: [PATCH 4/4] xfs: SGI ACLs: Prepare for richacls
From: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
Date: Mon, 26 Oct 2015 21:15:51 +0100
Cc: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat_com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZiAFxDWwRYRyBebX5HOnCpZzTcr+f45JV/R23VqTRFA=; b=cv11aHf8SvDzWA+8KDtpQDl9gjxX9KnwilB6S8pnNm+DnYj8pokvVLrNqjQRAIlJpJ 1ALNrWZlld+8qU5fMB6viqcQ8GaVBEhsWtCOaBTdoB5M1xSEAdnONlRiBL/YRZaHJnjy grg8u7nDEz7RlGl9Sb8gb4Mu0yrkopXH4oCRxY7R+XFeM/QGd8UTUI3AtsGuYfyFMVC1 PDq0O50eoVmm5TPx65BxT3zVUIa37QeL7fNZv9HLLjJWaAAy86ul3jL+KDiNkc2w2HO/ erS2AA7+x3BNst/jLnaHK11yu7MBrZW9OnevgfwUb0glccRdweMqsbyHEYtm7Plv30J8 H2nw==
In-reply-to: <1445721369-25679-5-git-send-email-agruenba@xxxxxxxxxx>
References: <1445721369-25679-1-git-send-email-agruenba@xxxxxxxxxx> <1445721369-25679-5-git-send-email-agruenba@xxxxxxxxxx>
On Sat, Oct 24, 2015 at 11:16 PM, Andreas Gruenbacher
<agruenba@xxxxxxxxxx> wrote:
> In case an inode has trusted.SGI_ACL_* attributes but POSIX ACLs are not
> enabled, treat those attributes as normal trusted attributes and bypass the
> get_acl and set_acl inode operations to prevent corrupting inode->i_mode,
> inode->i_acl, or inode->i_default_acl.
>
> Signed-off-by: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
> ---
>  fs/xfs/xfs_acl.c   |  5 +++++
>  fs/xfs/xfs_xattr.c |  5 +++--
>  fs/xfs/xfs_xattr.h | 28 ++++++++++++++++++++++++++++
>  3 files changed, 36 insertions(+), 2 deletions(-)
>  create mode 100644 fs/xfs/xfs_xattr.h
>
> diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
> index 64ffb85..bee1493 100644
> --- a/fs/xfs/xfs_acl.c
> +++ b/fs/xfs/xfs_acl.c
> @@ -21,6 +21,7 @@
>  #include "xfs_trans_resv.h"
>  #include "xfs_mount.h"
>  #include "xfs_inode.h"
> +#include "xfs_xattr.h"
>  #include "xfs_acl.h"
>  #include "xfs_attr.h"
>  #include "xfs_trace.h"
> @@ -319,6 +320,8 @@ xfs_xattr_acl_get(struct dentry *dentry, const char *name,
>         struct posix_acl *acl;
>         int error;
>
> +       if (!IS_POSIXACL(inode))
> +               return xfs_xattr_get(dentry, name, value, size, type);

This doesn't give us UID/GID mapping. In-place rewriting as the VFS
does would help, but the value is a const * here so we cannot really
modify it.

>         if (S_ISLNK(inode->i_mode))
>                 return -EOPNOTSUPP;
>


Andreas

<Prev in Thread] Current Thread [Next in Thread>