commit ec2dfa888aa64b81702bc2b5e8abb8c4d3ab9e09
Author: Jeff Layton <[EMAIL PROTECTED]>
Date:   Fri Nov 16 13:45:29 2007 -0500

    Unionfs: fix unionfs_setattr to handle ATTR_KILL_S*ID
    
    Don't allow unionfs_setattr to trip the BUG() in notify_change. Clear
    ATTR_MODE if the either ATTR_KILL_S*ID is set. This also allows the
    lower filesystem to interpret these bits in its own way.
    
    Signed-off-by: Jeff Layton <[EMAIL PROTECTED]>
    Cc: Josef 'Jeff' Sipek <[EMAIL PROTECTED]>
    Cc: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Erez Zadok <[EMAIL PROTECTED]>

diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c
index cfa5df0..22edc11 100644
--- a/fs/unionfs/inode.c
+++ b/fs/unionfs/inode.c
@@ -884,6 +884,13 @@ static int unionfs_setattr(struct dentry *dentry, struct 
iattr *ia)
        bend = dbend(dentry);
        inode = dentry->d_inode;
 
+       /*
+        * mode change is for clearing setuid/setgid. Allow lower filesystem
+        * to reinterpret it in its own way.
+        */
+       if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
+               ia->ia_valid &= ~ATTR_MODE;
+
        for (bindex = bstart; (bindex <= bend) || (bindex == bstart);
             bindex++) {
                lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to