Hello.

I have LiveCD.

Mount options are like this:

/mnt/root//etc /etc unionfs
rw,dirs=/mnt/root/etc=rw:/etc=ro,debug=4294967295,delete=whiteout 0 0

CD-ROM contain /etc/tcb/user directory with 'drwx--x---' rights

[EMAIL PROTECTED] # chmod 2710 /etc/tcb/user directory now with 'drwx--s---' rights

/etc/tcb/user is owned by 'user' (uid) and 'auth' (gid)

[EMAIL PROTECTED] $ touch /etc/tcb/user/test_file
[EMAIL PROTECTED] $ ls -l /etc/tcb/user/test_file
-rw-r--r-- 1 user user 0 Aug 21 06:49 test_file
Instead of:
-rw-r--r-- 1 user auth 0 Aug 21 06:49 test_file

So, SGID flag for directory doesn't make any sense.

Please, see attached patch. Does it solve this problem ?

Thanks.
diff -ruN linux-2.6.18/fs/unionfs/inode.c 
linux-2.6.18-modified/fs/unionfs/inode.c
--- linux-2.6.18/fs/unionfs/inode.c     2007-08-20 16:23:45 +0400
+++ linux-2.6.18-modified/fs/unionfs/inode.c    2007-08-20 16:20:44 +0400
@@ -85,7 +85,12 @@
 
                newattrs.ia_mode = mode & ~current->fs->umask;
                newattrs.ia_uid = current->fsuid;
-               newattrs.ia_gid = current->fsgid;
+               else if (parent->i_mode & S_ISGID) {
+                       newattrs.i_gid = parent->i_gid;
+                       if (S_ISDIR(mode))
+                               mode |= S_ISGID;
+               } else
+                       newattrs.ia_gid = current->fsgid;
 
                if (wh_dentry->d_inode->i_size != 0) {
                        newattrs.ia_valid |= ATTR_SIZE;
_______________________________________________
unionfs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs

Reply via email to