lkml.org 
[lkml]   [2007]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 17/25] procfs: add attr_kill_to_mode to setattr functions
Not sure if this is really needed, but I don't think it will hurt anything

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-06 15:31    [W:0.026 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site