From owner-svn-src-all@freebsd.org Tue Jan 1 08:27:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81A971425E8A; Tue, 1 Jan 2019 08:27:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 213668A850; Tue, 1 Jan 2019 08:27:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id C7194517; Tue, 1 Jan 2019 08:27:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [10.0.2.193] (ptr-8rh08jyvagy17tghbsd.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:240e:402:34da:bb47:a884:a9ed]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 15A05348AC; Tue, 1 Jan 2019 09:27:26 +0100 (CET) From: "Kristof Provost" To: "John Baldwin" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342599 - head/sys/kern Date: Tue, 01 Jan 2019 09:27:24 +0100 X-Mailer: MailMate (2.0BETAr6133) Message-ID: <99BBC967-981C-41CD-8928-98FEC7532F27@FreeBSD.org> In-Reply-To: References: <201812292136.wBTLa25i072560@repo.freebsd.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 213668A850 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.939,0] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2019 08:27:28 -0000 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