.. | .. |
---|
666 | 666 | newattrs.ia_valid |= ATTR_GID; |
---|
667 | 667 | newattrs.ia_gid = gid; |
---|
668 | 668 | } |
---|
669 | | - if (!S_ISDIR(inode->i_mode)) |
---|
670 | | - newattrs.ia_valid |= |
---|
671 | | - ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV; |
---|
672 | 669 | inode_lock(inode); |
---|
| 670 | + if (!S_ISDIR(inode->i_mode)) |
---|
| 671 | + newattrs.ia_valid |= ATTR_KILL_SUID | ATTR_KILL_PRIV | |
---|
| 672 | + setattr_should_drop_sgid(inode); |
---|
673 | 673 | error = security_path_chown(path, uid, gid); |
---|
674 | 674 | if (!error) |
---|
675 | 675 | error = notify_change(path->dentry, &newattrs, &delegated_inode); |
---|
.. | .. |
---|
1112 | 1112 | lookup_flags |= LOOKUP_IN_ROOT; |
---|
1113 | 1113 | if (how->resolve & RESOLVE_CACHED) { |
---|
1114 | 1114 | /* Don't bother even trying for create/truncate/tmpfile open */ |
---|
1115 | | - if (flags & (O_TRUNC | O_CREAT | O_TMPFILE)) |
---|
| 1115 | + if (flags & (O_TRUNC | O_CREAT | __O_TMPFILE)) |
---|
1116 | 1116 | return -EAGAIN; |
---|
1117 | 1117 | lookup_flags |= LOOKUP_CACHED; |
---|
1118 | 1118 | } |
---|