summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_sched.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2014-03-30 21:54:48 +0000
committerguenther <guenther@openbsd.org>2014-03-30 21:54:48 +0000
commitd559b8cb6cdd6f912edd28712213aec79fb0b7bc (patch)
treeffe701d81fb3c6b370ebfd396ab32a273424b5b5 /sys/compat/linux/linux_sched.c
parentSupport relative arguments to .ll (increase or decrease line length). (diff)
downloadwireguard-openbsd-d559b8cb6cdd6f912edd28712213aec79fb0b7bc.tar.xz
wireguard-openbsd-d559b8cb6cdd6f912edd28712213aec79fb0b7bc.zip
Eliminates struct pcred by moving the real and saved ugids into
struct ucred; struct process then directly links to the ucred Based on a discussion at c2k10 or so before noting that FreeBSD and NetBSD did this too. ok matthew@
Diffstat (limited to 'sys/compat/linux/linux_sched.c')
-rw-r--r--sys/compat/linux/linux_sched.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/sys/compat/linux/linux_sched.c b/sys/compat/linux/linux_sched.c
index fa071ca93c9..02c15c20f90 100644
--- a/sys/compat/linux/linux_sched.c
+++ b/sys/compat/linux/linux_sched.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_sched.c,v 1.16 2014/02/12 05:47:36 guenther Exp $ */
+/* $OpenBSD: linux_sched.c,v 1.17 2014/03/30 21:54:49 guenther Exp $ */
/* $NetBSD: linux_sched.c,v 1.6 2000/05/28 05:49:05 thorpej Exp $ */
/*-
@@ -211,16 +211,16 @@ linux_sys_sched_setparam(struct proc *cp, void *v, register_t *retval)
return (error);
if (SCARG(uap, pid) != 0) {
- struct pcred *pc = cp->p_cred;
+ struct ucred *uc = cp->p_ucred;
if ((p = pfind(SCARG(uap, pid))) == NULL)
return (ESRCH);
if (!(cp == p ||
- pc->pc_ucred->cr_uid == 0 ||
- pc->p_ruid == p->p_cred->p_ruid ||
- pc->pc_ucred->cr_uid == p->p_cred->p_ruid ||
- pc->p_ruid == p->p_ucred->cr_uid ||
- pc->pc_ucred->cr_uid == p->p_ucred->cr_uid))
+ uc->cr_uid == 0 ||
+ uc->cr_ruid == p->p_ucred->cr_ruid ||
+ uc->cr_uid == p->p_ucred->cr_ruid ||
+ uc->cr_ruid == p->p_ucred->cr_uid ||
+ uc->cr_uid == p->p_ucred->cr_uid))
return (EPERM);
}
@@ -245,16 +245,16 @@ linux_sys_sched_getparam(struct proc *cp, void *v, register_t *retval)
return (EINVAL);
if (SCARG(uap, pid) != 0) {
- struct pcred *pc = cp->p_cred;
+ struct ucred *uc = cp->p_ucred;
if ((p = pfind(SCARG(uap, pid))) == NULL)
return (ESRCH);
if (!(cp == p ||
- pc->pc_ucred->cr_uid == 0 ||
- pc->p_ruid == p->p_cred->p_ruid ||
- pc->pc_ucred->cr_uid == p->p_cred->p_ruid ||
- pc->p_ruid == p->p_ucred->cr_uid ||
- pc->pc_ucred->cr_uid == p->p_ucred->cr_uid))
+ uc->cr_uid == 0 ||
+ uc->cr_ruid == p->p_ucred->cr_ruid ||
+ uc->cr_uid == p->p_ucred->cr_ruid ||
+ uc->cr_ruid == p->p_ucred->cr_uid ||
+ uc->cr_uid == p->p_ucred->cr_uid))
return (EPERM);
}
@@ -286,16 +286,16 @@ linux_sys_sched_setscheduler(struct proc *cp, void *v, register_t *retval)
return (error);
if (SCARG(uap, pid) != 0) {
- struct pcred *pc = cp->p_cred;
+ struct ucred *uc = cp->p_ucred;
if ((p = pfind(SCARG(uap, pid))) == NULL)
return (ESRCH);
if (!(cp == p ||
- pc->pc_ucred->cr_uid == 0 ||
- pc->p_ruid == p->p_cred->p_ruid ||
- pc->pc_ucred->cr_uid == p->p_cred->p_ruid ||
- pc->p_ruid == p->p_ucred->cr_uid ||
- pc->pc_ucred->cr_uid == p->p_ucred->cr_uid))
+ uc->cr_uid == 0 ||
+ uc->cr_ruid == p->p_ucred->cr_ruid ||
+ uc->cr_uid == p->p_ucred->cr_ruid ||
+ uc->cr_ruid == p->p_ucred->cr_uid ||
+ uc->cr_uid == p->p_ucred->cr_uid))
return (EPERM);
}
@@ -323,16 +323,16 @@ linux_sys_sched_getscheduler(struct proc *cp, void *v, register_t *retval)
*/
if (SCARG(uap, pid) != 0) {
- struct pcred *pc = cp->p_cred;
+ struct ucred *uc = cp->p_ucred;
if ((p = pfind(SCARG(uap, pid))) == NULL)
return (ESRCH);
if (!(cp == p ||
- pc->pc_ucred->cr_uid == 0 ||
- pc->p_ruid == p->p_cred->p_ruid ||
- pc->pc_ucred->cr_uid == p->p_cred->p_ruid ||
- pc->p_ruid == p->p_ucred->cr_uid ||
- pc->pc_ucred->cr_uid == p->p_ucred->cr_uid))
+ uc->cr_uid == 0 ||
+ uc->cr_ruid == p->p_ucred->cr_ruid ||
+ uc->cr_uid == p->p_ucred->cr_ruid ||
+ uc->cr_ruid == p->p_ucred->cr_uid ||
+ uc->cr_uid == p->p_ucred->cr_uid))
return (EPERM);
}