diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2006-06-26 03:25:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:23 -0400 |
commit | 87bfbf679ffb1e95dd9ada694f66aafc4bfa5959 (patch) | |
tree | f4f549435f64bd1c42594dcb4d27d9de92e379f6 /fs/proc/base.c | |
parent | 167965495153ba9829d0a34b6800dbf5d94de8c8 (diff) |
[PATCH] proc: Simplify the ownership rules for /proc
Currently in /proc if the task is dumpable all of files are owned by the tasks
effective users. Otherwise the files are owned by root. Unless it is the
/proc/<tgid>/ or /proc/<tgid>/task/<pid> directory in that case we always make
the directory owned by the effective user.
However the special case for directories is pointless except as a way to read
the effective user, because the permissions on both of those directories are
world readable, and executable.
/proc/<tgid>/status provides a much better way to read a processes effecitve
userid, so it is silly to try to provide that on the directory.
So this patch simplifies the code by removing a pointless special case and
gets us one step closer to being able to remove the hard coded /proc inode
numbers.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 0762bc34d98b..fa0e6bee40fa 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1371,7 +1371,7 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st | |||
1371 | ei->type = ino; | 1371 | ei->type = ino; |
1372 | inode->i_uid = 0; | 1372 | inode->i_uid = 0; |
1373 | inode->i_gid = 0; | 1373 | inode->i_gid = 0; |
1374 | if (ino == PROC_TGID_INO || ino == PROC_TID_INO || task_dumpable(task)) { | 1374 | if (task_dumpable(task)) { |
1375 | inode->i_uid = task->euid; | 1375 | inode->i_uid = task->euid; |
1376 | inode->i_gid = task->egid; | 1376 | inode->i_gid = task->egid; |
1377 | } | 1377 | } |
@@ -1400,7 +1400,7 @@ static int pid_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
1400 | struct inode *inode = dentry->d_inode; | 1400 | struct inode *inode = dentry->d_inode; |
1401 | struct task_struct *task = proc_task(inode); | 1401 | struct task_struct *task = proc_task(inode); |
1402 | if (pid_alive(task)) { | 1402 | if (pid_alive(task)) { |
1403 | if (proc_type(inode) == PROC_TGID_INO || proc_type(inode) == PROC_TID_INO || task_dumpable(task)) { | 1403 | if (task_dumpable(task)) { |
1404 | inode->i_uid = task->euid; | 1404 | inode->i_uid = task->euid; |
1405 | inode->i_gid = task->egid; | 1405 | inode->i_gid = task->egid; |
1406 | } else { | 1406 | } else { |