[PATCH 17/25] procfs: add attr_kill_to_mode to setattr functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Not sure if this is really needed, but I don't think it will hurt anything

Signed-off-by: Jeff Layton <[email protected]>
---
 fs/proc/base.c        |    3 +++
 fs/proc/generic.c     |    3 +++
 fs/proc/proc_sysctl.c |    3 +++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 3c77d5a..d2e56ba 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -348,6 +348,9 @@ static int proc_setattr(struct dentry *dentry, struct iattr *attr)
 	int error;
 	struct inode *inode = dentry->d_inode;
 
+	/* FIXME: is this necessary? */
+	attr_kill_to_mode(inode, attr);
+
 	if (attr->ia_valid & ATTR_MODE)
 		return -EPERM;
 
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index b5e7155..88d736c 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -239,6 +239,9 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
 	struct proc_dir_entry *de = PDE(inode);
 	int error;
 
+	/* FIXME: is this necessary? */
+	attr_kill_to_mode(inode, iattr);
+
 	error = inode_change_ok(inode, iattr);
 	if (error)
 		goto out;
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 680c429..37c0cca 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -425,6 +425,9 @@ static int proc_sys_setattr(struct dentry *dentry, struct iattr *attr)
 	struct inode *inode = dentry->d_inode;
 	int error;
 
+	/* FIXME: is this necessary */
+	attr_kill_to_mode(inode, attr);
+
 	if (attr->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID))
 		return -EPERM;
 
-- 
1.5.2.2

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux