coredump: use SUID_DUMPABLE_ENABLED rather than hardcoded 1
authorOleg Nesterov <oleg@redhat.com>
Fri, 5 Oct 2012 00:15:27 +0000 (17:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Oct 2012 18:05:16 +0000 (03:05 +0900)
Cosmetic. Change setup_new_exec() and task_dumpable() to use
SUID_DUMPABLE_ENABLED for /bin/grep.

[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/exec.c
fs/proc/internal.h

index bd941a1cdbfc1f45860f93e1b8eca1083250f4c3..9824473a7ec1688737c2150ca8bd246587e7250b 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1097,7 +1097,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);
 
index 67925a7bd8cb757f56db940efcff1fe9c7ef112a..cceaab07ad549caaa124b71e3db01f126052ef59 100644 (file)
@@ -103,7 +103,7 @@ static inline 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;
 }