xfs
[Top] [All Lists]

Re: Problems with ACL inheritance and chacl & maybe a BUG

To: John Trostel <jtrostel@xxxxxxxxxx>
Subject: Re: Problems with ACL inheritance and chacl & maybe a BUG
From: Timothy Shimmin <tes@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 3 Apr 2001 17:47:55 +1000
Cc: Carlos Gamboa Dos Santos <Carlos.Gamboa@xxxxxx>, linux-xfs@xxxxxxxxxxx, Andrew Gildfind <ajag@xxxxxxxxxxxxxxxxxxxxxxx>
In-reply-to: <XFMail.20010329172932.jtrostel@connex.com>; from jtrostel@connex.com on Thu, Mar 29, 2001 at 05:29:32PM -0500
References: <3AC35789.FF9BBCA@iee.lu> <XFMail.20010329172932.jtrostel@connex.com>
Sender: owner-linux-xfs@xxxxxxxxxxx
Hi,

After looking at the Revised section 5 in the withdrawn
ACL standard, 5.3.1.2 states how a newly created file will
obtain its ACLs.
And indeed, if the ACLs are turned on and a file is created
in a directory which has a default ACL, then the umask
is not supposed to be used at all - only the default ACL and
the operation's mode are to be used.
The rational for this is given in section B.23.5 where it
actually explicitly says that the umask is not to be used.

Looking at the code in fs/xfs/xfs_acl.c and xfs_acl_inherit()
it is doing the right thing.
However, by this stage of setting up the acl the vap->va_mode
has already been changed by the umask !
So there is our bug.

In fs/namei.c (vfs_create(), vfs_mknod() and vfs_mkdir())
it updates the mode with the umask (before we get to see the
mode argument).
There needs to be a test on the directory to see if it
has a default ACL before updating the mode with the umask.

Looking at Andreas' ACL patch, he has in fact patched fs/namei.c
for each case of where umask is used.
If the inode's fs has ACLs turned on
  (inode)->i_sb->s_ext_attr_flags & EXT_ATTR_FLAG_POSIX_ACL
then he doesn't use the umask.
Then in the ACL code, he uses the umask if the directory
doesn't have a default ACL. 

I'll have a look at ways to fix our code tomorrow.

Cheers,
Tim.

<Prev in Thread] Current Thread [Next in Thread>
  • Re: Problems with ACL inheritance and chacl & maybe a BUG, Timothy Shimmin <=