Carlos Maiolino 42c49d7f24 xfs: fix sgid inheritance for subdirectories inheriting default acls [V3]
XFS removes sgid bits of subdirectories under a directory containing a default
acl.

When a default acl is set, it implies xfs to call xfs_setattr_nonsize() in its
code path. Such function is shared among mkdir and chmod system calls, and
does some checks unneeded by mkdir (calling inode_change_ok()). Such checks
remove sgid bit from the inode after it has been granted.

With this patch, we extend the meaning of XFS_ATTR_NOACL flag to avoid these
checks when acls are being inherited (thanks hch).

Also, xfs_setattr_mode, doesn't need to re-check for group id and capabilities
permissions, this only implies in another try to remove sgid bit from the
directories. Such check is already done either on inode_change_ok() or
xfs_setattr_nonsize().

Changelog:

V2: Extends the meaning of XFS_ATTR_NOACL instead of wrap the tests into another
    function

V3: Remove S_ISDIR check in xfs_setattr_nonsize() from the patch

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
2013-07-10 10:21:51 -05:00
..
2013-05-07 18:45:36 -05:00
2013-06-27 13:34:12 -05:00
2013-05-07 18:45:36 -05:00
2011-08-12 16:21:35 -05:00
2011-08-12 16:21:35 -05:00
2012-11-19 20:11:24 -06:00
2013-04-21 14:57:43 -05:00
2013-05-23 18:04:06 -05:00
2013-05-23 18:04:06 -05:00
2013-05-07 18:45:36 -05:00
2013-05-23 18:04:06 -05:00
2012-11-19 20:11:24 -06:00
2011-07-13 13:43:48 +02:00
2011-08-12 16:21:35 -05:00
2011-08-12 16:21:35 -05:00
2011-03-07 10:09:35 +11:00
2011-08-12 16:21:35 -05:00
2013-05-07 20:16:25 -07:00
2013-06-27 14:27:18 -05:00
2013-06-27 14:26:21 -05:00
2013-06-27 13:34:12 -05:00
2013-06-27 13:34:12 -05:00
2012-05-14 16:20:54 -05:00
2011-08-12 16:21:35 -05:00
2011-08-12 16:21:35 -05:00
2010-12-16 16:05:51 -06:00
2011-08-12 16:21:35 -05:00
2013-05-07 18:45:36 -05:00
2013-06-27 13:34:12 -05:00
2013-05-07 18:45:36 -05:00
2013-05-07 18:45:36 -05:00
2013-06-19 14:54:17 -05:00
2012-10-17 12:01:25 -05:00
2013-06-27 13:34:12 -05:00
2012-01-03 22:55:00 -05:00
2011-08-12 16:21:35 -05:00
2013-05-07 18:45:36 -05:00