Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751506AbWBWQBp (ORCPT ); Thu, 23 Feb 2006 11:01:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751508AbWBWQBp (ORCPT ); Thu, 23 Feb 2006 11:01:45 -0500 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:62870 "EHLO ebiederm.dsl.xmission.com") by vger.kernel.org with ESMTP id S1751506AbWBWQBo (ORCPT ); Thu, 23 Feb 2006 11:01:44 -0500 To: Andrew Morton Cc: Subject: [PATCH 05/23] proc: Simplify the ownership rules for /proc References: From: ebiederm@xmission.com (Eric W. Biederman) Date: Thu, 23 Feb 2006 09:00:30 -0700 In-Reply-To: (Eric W. Biederman's message of "Thu, 23 Feb 2006 08:58:55 -0700") Message-ID: User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2002 Lines: 56 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// or /proc//task/ 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//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 --- fs/proc/base.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 453d43f2b9e9fee71c23007f1cfe5dbedd9d3790 diff --git a/fs/proc/base.c b/fs/proc/base.c index 56ca519..c35f340 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1324,7 +1324,7 @@ static struct inode *proc_pid_make_inode ei->type = ino; inode->i_uid = 0; inode->i_gid = 0; - if (ino == PROC_TGID_INO || ino == PROC_TID_INO || task_dumpable(task)) { + if (task_dumpable(task)) { inode->i_uid = task->euid; inode->i_gid = task->egid; } @@ -1353,7 +1353,7 @@ static int pid_revalidate(struct dentry struct inode *inode = dentry->d_inode; struct task_struct *task = proc_task(inode); if (pid_alive(task)) { - if (proc_type(inode) == PROC_TGID_INO || proc_type(inode) == PROC_TID_INO || task_dumpable(task)) { + if (task_dumpable(task)) { inode->i_uid = task->euid; inode->i_gid = task->egid; } else { -- 1.2.2.g709a - 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/