commit e4c68550d8484616644ea975ae52c1b31d23bbaf
Author: Erez_Zadok <[EMAIL PROTECTED]>
Date: Fri Nov 16 13:46:46 2007 -0500
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 757f47c..c127356 100644
--- a/fs/unionfs/inode.c
+++ b/fs/unionfs/inode.c
@@ -726,6 +726,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.
@@ -734,11 +739,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