aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2010-04-07 15:15:02 -0400
committerJames Morris <jmorris@namei.org>2010-04-11 22:19:16 -0400
commit43ed8c3b4573d5f5cd314937fee63b4ab046ac5f (patch)
treebb3f094daa6f0c3f49c4c47fb5ac1c80a26e9698 /kernel
parent0968d0060a3c885e53d453380266c7792a55d302 (diff)
security: remove dead hook task_setuid
Unused hook. Remove. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sys.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 8298878f4f71..396c11cd9a20 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -609,10 +609,6 @@ SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid)
609 return -ENOMEM; 609 return -ENOMEM;
610 old = current_cred(); 610 old = current_cred();
611 611
612 retval = security_task_setuid(ruid, euid, (uid_t)-1, LSM_SETID_RE);
613 if (retval)
614 goto error;
615
616 retval = -EPERM; 612 retval = -EPERM;
617 if (ruid != (uid_t) -1) { 613 if (ruid != (uid_t) -1) {
618 new->uid = ruid; 614 new->uid = ruid;
@@ -674,10 +670,6 @@ SYSCALL_DEFINE1(setuid, uid_t, uid)
674 return -ENOMEM; 670 return -ENOMEM;
675 old = current_cred(); 671 old = current_cred();
676 672
677 retval = security_task_setuid(uid, (uid_t)-1, (uid_t)-1, LSM_SETID_ID);
678 if (retval)
679 goto error;
680
681 retval = -EPERM; 673 retval = -EPERM;
682 if (capable(CAP_SETUID)) { 674 if (capable(CAP_SETUID)) {
683 new->suid = new->uid = uid; 675 new->suid = new->uid = uid;
@@ -718,9 +710,6 @@ SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid)
718 if (!new) 710 if (!new)
719 return -ENOMEM; 711 return -ENOMEM;
720 712
721 retval = security_task_setuid(ruid, euid, suid, LSM_SETID_RES);
722 if (retval)
723 goto error;
724 old = current_cred(); 713 old = current_cred();
725 714
726 retval = -EPERM; 715 retval = -EPERM;
@@ -850,9 +839,6 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid)
850 old = current_cred(); 839 old = current_cred();
851 old_fsuid = old->fsuid; 840 old_fsuid = old->fsuid;
852 841
853 if (security_task_setuid(uid, (uid_t)-1, (uid_t)-1, LSM_SETID_FS) < 0)
854 goto error;
855
856 if (uid == old->uid || uid == old->euid || 842 if (uid == old->uid || uid == old->euid ||
857 uid == old->suid || uid == old->fsuid || 843 uid == old->suid || uid == old->fsuid ||
858 capable(CAP_SETUID)) { 844 capable(CAP_SETUID)) {
@@ -863,7 +849,6 @@ SYSCALL_DEFINE1(setfsuid, uid_t, uid)
863 } 849 }
864 } 850 }
865 851
866error:
867 abort_creds(new); 852 abort_creds(new);
868 return old_fsuid; 853 return old_fsuid;
869 854