Commit f38b769d authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] ATTR_MODE breakage

(originally caught by Paul Larson <plars@austin.ibm.com>)

	Patch fixes a couple of idiotic bugs in notify_change() (my
fault).  Unary operations have higher priority than binary ones, so
if (!valid & ATTR_MODE) doesn't do the right thing.  I plead temporary
braindamage...
parent b7d1200e
......@@ -134,7 +134,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
attr->ia_mtime = now;
if (ia_valid & ATTR_KILL_SUID) {
if (mode & S_ISUID) {
if (!ia_valid & ATTR_MODE) {
if (!(ia_valid & ATTR_MODE)) {
ia_valid = attr->ia_valid |= ATTR_MODE;
attr->ia_mode = inode->i_mode;
}
......@@ -143,7 +143,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr)
}
if (ia_valid & ATTR_KILL_SGID) {
if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
if (!ia_valid & ATTR_MODE) {
if (!(ia_valid & ATTR_MODE)) {
ia_valid = attr->ia_valid |= ATTR_MODE;
attr->ia_mode = inode->i_mode;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment