From owner-freebsd-bugs Tue Jul 16 10:10: 9 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F2E0A37B400 for ; Tue, 16 Jul 2002 10:10:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9648443E31 for ; Tue, 16 Jul 2002 10:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g6GHA3JU037507 for ; Tue, 16 Jul 2002 10:10:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g6GHA3LJ037506; Tue, 16 Jul 2002 10:10:03 -0700 (PDT) Date: Tue, 16 Jul 2002 10:10:03 -0700 (PDT) Message-Id: <200207161710.g6GHA3LJ037506@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Shannon -jj Behrens Subject: Re: kern/40611: [PATCH] linux JRE 1.4 under linux compatibility only runs as root (kernel patch) Reply-To: Shannon -jj Behrens Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/40611; it has been noted by GNATS. From: Shannon -jj Behrens To: freebsd-gnats-submit@FreeBSD.org, jj@nttmcl.com Cc: Subject: Re: kern/40611: [PATCH] linux JRE 1.4 under linux compatibility only runs as root (kernel patch) Date: Tue, 16 Jul 2002 10:07:14 -0700 Here is an updated patch from Antony T Curtis . It was applied to his 4.6-STABLE system. --- p1003_1b.c.orig Thu Aug 3 02:09:59 2000 +++ p1003_1b.c Fri Jul 12 21:44:24 2002 @@ -178,15 +178,22 @@ int sched_getparam(struct proc *p, struct sched_getparam_args *uap) { - int e; + int e = 0; + struct proc *targetp; struct sched_param sched_param; - (void) (0 - || (e = p31b_proc(p, uap->pid, &p)) - || (e = ksched_getparam(&p->p_retval[0], ksched, p, &sched_param)) - ); + if (uap->pid == 0) { + targetp = p; + } else { + targetp = pfind(uap->pid); + if (targetp == NULL) + e = ESRCH; + } + + if (e == 0) + e = ksched_getparam(&p->p_retval[0], ksched, targetp, &sched_param); - if (!e) + if (e == 0) copyout(&sched_param, uap->param, sizeof(sched_param)); return e; @@ -211,13 +218,21 @@ int sched_getscheduler(struct proc *p, struct sched_getscheduler_args *uap) { - int e; - (void) (0 - || (e = p31b_proc(p, uap->pid, &p)) - || (e = ksched_getscheduler(&p->p_retval[0], ksched, p)) - ); + int e = 0; + struct proc *targetp; - return e; + if (uap->pid == 0) { + targetp = p; + } else { + targetp = pfind(uap->pid); + if (targetp == NULL) + e = ESRCH; + } + + if (e == 0) + e = ksched_getscheduler(&p->p_retval[0], ksched, targetp); + + return (e); } int sched_yield(struct proc *p, struct sched_yield_args *uap) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message