[JFFS2] Don't strip sgid bit from inode permissions

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Nov 1 16:59:01 EDT 2007


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=857013b87b6e0fea776c1f0b365dbce3d6eba8c6
Commit:     857013b87b6e0fea776c1f0b365dbce3d6eba8c6
Parent:     15953580e79b58caefb107e77f218e009b9992e6
Author:     David Woodhouse <dwmw2 at infradead.org>
AuthorDate: Thu Nov 1 16:27:38 2007 -0400
Committer:  David Woodhouse <dwmw2 at infradead.org>
CommitDate: Thu Nov 1 16:27:38 2007 -0400

    [JFFS2] Don't strip sgid bit from inode permissions
    
    <viro> dwmw2: anyway, removing sgid from directories or from
           files without S_IXGRP is a plain and simple bug
    <viro> these days you don't need that logics at all - simply remove it
    
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
---
 fs/jffs2/fs.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c
index d2e06f7..ee192af 100644
--- a/fs/jffs2/fs.c
+++ b/fs/jffs2/fs.c
@@ -97,11 +97,7 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
 	ri->gid = cpu_to_je16((ivalid & ATTR_GID)?iattr->ia_gid:inode->i_gid);
 
 	if (ivalid & ATTR_MODE)
-		if (iattr->ia_mode & S_ISGID &&
-		    !in_group_p(je16_to_cpu(ri->gid)) && !capable(CAP_FSETID))
-			ri->mode = cpu_to_jemode(iattr->ia_mode & ~S_ISGID);
-		else
-			ri->mode = cpu_to_jemode(iattr->ia_mode);
+		ri->mode = cpu_to_jemode(iattr->ia_mode);
 	else
 		ri->mode = cpu_to_jemode(inode->i_mode);
 



More information about the linux-mtd-cvs mailing list