[PATCH] coredump: use SUID_DUMPABLE_ENABLED rather than hardcoded 1

From: Oleg Nesterov
Date: Fri Sep 14 2012 - 08:41:33 EST


Cosmetic. Change setup_new_exec() and task_dumpable() to use
SUID_DUMPABLE_ENABLED for /bin/grep.

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
---
fs/exec.c | 2 +-
fs/proc/base.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index 905e94b..1d3dfc5 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1125,7 +1125,7 @@ void setup_new_exec(struct linux_binprm * bprm)
current->sas_ss_sp = current->sas_ss_size = 0;

if (uid_eq(current_euid(), current_uid()) && gid_eq(current_egid(), current_gid()))
- set_dumpable(current->mm, 1);
+ set_dumpable(current->mm, SUID_DUMPABLE_ENABLED);
else
set_dumpable(current->mm, suid_dumpable);

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 21fb230..7f40bb7 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1398,7 +1398,7 @@ static int task_dumpable(struct task_struct *task)
if (mm)
dumpable = get_dumpable(mm);
task_unlock(task);
- if(dumpable == 1)
+ if(dumpable == SUID_DUMPABLE_ENABLED)
return 1;
return 0;
}
--
1.5.5.1


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