commit de306a38349091cd925610ffc5cadfcda905fdce
Author: Erez_Zadok <[EMAIL PROTECTED]>
Date:   Wed Aug 1 10:29:42 2007 -0400

    Unionfs: check for immutable files before read-only branches
    
    Immutable files should never be allowed to be copied-up on write, even if
    they're on read-only file systems or branches.
    
    Signed-off-by: Erez Zadok <[EMAIL PROTECTED]>

diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c
index 53d373a..c772fbd 100644
--- a/fs/unionfs/inode.c
+++ b/fs/unionfs/inode.c
@@ -985,6 +985,11 @@ static int inode_permission(struct super_block *sb, struct 
inode *inode, int mas
                    (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
                        return -EROFS;
                /*
+                * Nobody gets write access to an immutable file.
+                */
+               if (IS_IMMUTABLE(inode))
+                       return -EACCES;
+               /*
                 * For all other branches than the first one, we ignore
                 * EROFS or if the branch is mounted as readonly, to let
                 * copyup take place.
@@ -993,11 +998,6 @@ static int inode_permission(struct super_block *sb, struct 
inode *inode, int mas
                    is_robranch_super(sb, bindex) &&
                    (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
                        return 0;
-               /*
-                * Nobody gets write access to an immutable file.
-                */
-               if (IS_IMMUTABLE(inode))
-                       return -EACCES;
        }
 
        /* Ordinary permission routines do not understand MAY_APPEND. */
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to