summaryrefslogtreecommitdiff
path: root/fs/exec.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.davemloft.net>2004-04-22 01:25:25 -0700
committerDavid S. Miller <davem@nuts.davemloft.net>2004-04-22 01:25:25 -0700
commit88d0505c93f592c135ea730df4cebad96fd0df64 (patch)
tree950f1cf8636de5a1aab640b59cd92764b0f14c7c /fs/exec.c
parent16a76bdbafd6c681dd15419183308bba1dd58063 (diff)
parent98a5d354daf5357590bfc25521c91d67dc93de96 (diff)
Merge nuts.davemloft.net:/disk1/BK/network-2.6
into nuts.davemloft.net:/disk1/BK/net-2.6
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/fs/exec.c b/fs/exec.c
index c37b1478fdac..47285fe301ff 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -870,15 +870,6 @@ out:
EXPORT_SYMBOL(flush_old_exec);
-/*
- * We mustn't allow tracing of suid binaries, unless
- * the tracer has the capability to trace anything..
- */
-static inline int must_not_trace_exec(struct task_struct * p)
-{
- return (p->ptrace & PT_PTRACED) && !(p->ptrace & PT_PTRACE_CAP);
-}
-
/*
* Fill the binprm structure from the inode.
* Check permissions, then read the first 128 (BINPRM_BUF_SIZE) bytes
@@ -945,27 +936,7 @@ EXPORT_SYMBOL(prepare_binprm);
void compute_creds(struct linux_binprm *bprm)
{
- task_lock(current);
- if (bprm->e_uid != current->uid || bprm->e_gid != current->gid) {
- current->mm->dumpable = 0;
-
- if (must_not_trace_exec(current)
- || atomic_read(&current->fs->count) > 1
- || atomic_read(&current->files->count) > 1
- || atomic_read(&current->sighand->count) > 1) {
- if(!capable(CAP_SETUID)) {
- bprm->e_uid = current->uid;
- bprm->e_gid = current->gid;
- }
- }
- }
-
- current->suid = current->euid = current->fsuid = bprm->e_uid;
- current->sgid = current->egid = current->fsgid = bprm->e_gid;
-
- task_unlock(current);
-
- security_bprm_compute_creds(bprm);
+ security_bprm_apply_creds(bprm);
}
EXPORT_SYMBOL(compute_creds);