commit 4629bee540de295e315893369c484bdd5274ff48
Author: Erez Zadok <[EMAIL PROTECTED]>
Date:   Sun Nov 25 23:05:00 2007 -0500

    Unionfs: create opaque directories' whiteouts unconditionally
    
    Needed to maintain Unix semantics (LTP testing).
    
    Signed-off-by: Erez Zadok <[EMAIL PROTECTED]>

diff --git a/fs/unionfs/subr.c b/fs/unionfs/subr.c
index 48f0072..861de05 100644
--- a/fs/unionfs/subr.c
+++ b/fs/unionfs/subr.c
@@ -156,6 +156,19 @@ int make_dir_opaque(struct dentry *dentry, int bindex)
        int err = 0;
        struct dentry *lower_dentry, *diropq;
        struct inode *lower_dir;
+       kernel_cap_t orig_cap;
+
+       /*
+        * Opaque directory whiteout markers are special files (like regular
+        * whiteouts), and should appear to the users as if they don't
+        * exist.  They should be created/deleted regardless of directory
+        * search/create permissions, but only for the duration of this
+        * creation of the .wh.__dir_opaque: file.  Note, this does not
+        * circumvent normal ->permission).
+        */
+       orig_cap = current->cap_effective;
+       cap_raise(current->cap_effective, CAP_DAC_READ_SEARCH);
+       cap_raise(current->cap_effective, CAP_DAC_OVERRIDE);
 
        lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
        lower_dir = lower_dentry->d_inode;
@@ -179,6 +192,7 @@ int make_dir_opaque(struct dentry *dentry, int bindex)
 
 out:
        mutex_unlock(&lower_dir->i_mutex);
+       current->cap_effective = orig_cap;
        return err;
 }
 
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to