Skip to content

Commit

Permalink
[JFFS2] Don't strip sgid bit from inode permissions
Browse files Browse the repository at this point in the history
<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@infradead.org>
  • Loading branch information
David Woodhouse committed Nov 1, 2007
1 parent 1595358 commit 857013b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/jffs2/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 857013b

Please sign in to comment.