Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Jan 2019 09:27:24 +0100
From:      "Kristof Provost" <kp@FreeBSD.org>
To:        "John Baldwin" <jhb@FreeBSD.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r342599 - head/sys/kern
Message-ID:  <99BBC967-981C-41CD-8928-98FEC7532F27@FreeBSD.org>
In-Reply-To: <a5288be1-cc85-3057-25d0-b1ecb29a3a65@FreeBSD.org>
References:  <201812292136.wBTLa25i072560@repo.freebsd.org> <a5288be1-cc85-3057-25d0-b1ecb29a3a65@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1 Jan 2019, at 2:15, John Baldwin wrote:
> On 12/29/18 1:36 PM, Kristof Provost wrote:
>> Author: kp
>> Date: Sat Dec 29 21:36:02 2018
>> New Revision: 342599
>> URL: https://svnweb.freebsd.org/changeset/base/342599
>>
>> Log:
>>   Simplify jail ID printing on process exit
>>
>>   As suggested by kib@, we don't need to check p_ucred, because =

>> that's only NULL
>>   during process creation, and cr_prison is never NULL.
>>
>> Modified:
>>   head/sys/kern/kern_sig.c
>>
>> Modified: head/sys/kern/kern_sig.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/sys/kern/kern_sig.c	Sat Dec 29 21:18:01 2018	(r342598)
>> +++ head/sys/kern/kern_sig.c	Sat Dec 29 21:36:02 2018	(r342599)
>> @@ -3094,16 +3094,12 @@ proc_wkilled(struct proc *p)
>>  void
>>  killproc(struct proc *p, char *why)
>>  {
>> -	int jid =3D -1;
>>
>> -	if (p->p_ucred && p->p_ucred->cr_prison)
>> -		jid =3D p->p_ucred->cr_prison->pr_id;
>> -
>>  	PROC_LOCK_ASSERT(p, MA_OWNED);
>>  	CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", p, p->p_pid,
>>  	    p->p_comm);
>>  	log(LOG_ERR, "pid %d (%s), jid %d, uid %d, was killed: %s\n",
>> -	    p->p_pid, p->p_comm, jid,
>> +	    p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id,
>>  	    p->p_ucred ? p->p_ucred->cr_uid : -1, why);
>
> Could you fix the cr_uid cases to remove the ?: as a follow up?
>
Yes, although it=E2=80=99ll be a couple of days.

Regards,
Kristof=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99BBC967-981C-41CD-8928-98FEC7532F27>