From nobody Tue Jan 03 04:29:08 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NmKWK3tNxz2pThC; Tue, 3 Jan 2023 04:29:17 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NmKWK3GsDz3krv; Tue, 3 Jan 2023 04:29:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672720157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8WDcUCXwRfvqZcSLN9VWDOBBGp/ZKuervfeAXtmxUEM=; b=S0igbM6IKXiEwwQuwzNT0WVjQOj/lnlo7Hk/QNl4RxnEXWIe3DPTRn/1S6zBT/fbgcCv0q efVJbFLyU2lSRNdRuBGwv1Bl5dkKjjxf4fu8BkGZWspANGfMO6JVd1dE9Z+0zj74yOmWJt pFuk4qJRTyznYcwvnCfK1CbsfSZJhV5sKiazaSE3ZV9IjsNjNpowI8qqDNjjv7C/7huu+N 9cAmluJ9IYOY3y2Ob15urwPrpNlo5e+27unSuFCWt2g0eOeNMnJrIduU1msM4pQD7sScWM wNi6nltDjOWkp7qiUlWbAh9yiuA471TzPAJ3Q0YPs3JkYudHn8pTnWlj3+gjGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672720157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8WDcUCXwRfvqZcSLN9VWDOBBGp/ZKuervfeAXtmxUEM=; b=cJmjuLddzroV9URB2TuhfJP0rSyNl2+X8IVfVLxn0Ne/zJOqLzWKyQY0lunedA9syoOlhU pU6tUBmH/UqHU+YpdSA9F7RP64FtK28DwqBDQSFNZpdpHE70tWO6c+uQ/+E+0GqwgG3p37 WUyoZkbew59/KxW5JHNeupVjk2SpXpABC5ZZEyMDHcTlMFAiIw+ePKHr3xG7ugNjrQRp9q BfyNpih9pO3nlRBbK3N/JSBST+tdJFDWdLQ6RQqlPEgpUqfFDT9QkrL4xs0r2CQ7YmJ0o+ 3utv4XK9fpF83fu0B9OKZTeQxHoSEhQSOe6vsopwaBWFg4hzCPL0hnp7QgBTHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672720157; a=rsa-sha256; cv=none; b=KKq6Y9Wk0zOFT2tQxZeXCj76q7SDEVsolkxmd2m9ad/OZlkqBEJrWCYxUQq+XSrfAlq9V8 1MWMII1EOaAv85sRbHcR0qMQYyimK561VXIE/RYopckQZ3Jo4iE2q2nyunYmdvnMPcBC0n +yvR7iimyo/rX3FqucFj+oaSMtS8fuVHWbZDxaDuhQ1WllLdODymHgnyjmgXhON4f0jl5E g9EjYc6IaeECzcNxH2TDnP191qmoeh1QtPozBcjKGKL1uq9FoBZE5f81tZvT75s2Vc7KmX t9L3SWZn64kW4q/oOY5jpsKPTZ1+PfHvw/TbX1Sk8NZ0fAyUkL5wctbATSTtXA== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4NmKWK1RzRzwy9; Tue, 3 Jan 2023 04:29:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 9EAD94A3EC; Tue, 3 Jan 2023 05:29:13 +0100 (CET) From: Kristof Provost To: Eugene Grosbein Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: e9ae9fa93745 - main - syslog(3): unbreak log generation using fabricated PID Date: Tue, 03 Jan 2023 17:29:08 +1300 X-Mailer: MailMate (1.14r5918) Message-ID: In-Reply-To: <202208082230.278MUYZd078396@gitrepo.freebsd.org> References: <202208082230.278MUYZd078396@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-ThisMailContainsUnwantedMimeParts: N On 9 Aug 2022, at 10:30, Eugene Grosbein wrote: > The branch main has been updated by eugen: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3De9ae9fa93745669b7dd0341d= 333257ad6cfe8e37 > > commit e9ae9fa93745669b7dd0341d333257ad6cfe8e37 > Author: Eugene Grosbein > AuthorDate: 2022-08-08 22:21:02 +0000 > Commit: Eugene Grosbein > CommitDate: 2022-08-08 22:21:02 +0000 > > syslog(3): unbreak log generation using fabricated PID > > Recover application ability to supply fabricated PID > embedded into ident that was lost when libc switched > to generation of RFC 5424 log messages, for example: > > logger -t "ident[$$]" -p user.notice "test" > > It is essential for long running scripts. > Also, this change unbreaks matching resulted entries > by ident in syslog.conf: > > !ident > *.* /var/log/ident.log > > Without the fix, the log (and matching) was broken: > > Aug 1 07:36:58 hostname ident[123][86483]: test > > Now it works as expected and worked before breakage: > > Aug 1 07:39:40 hostname ident[123]: test > > Differential: https://reviews.freebsd.org/D36005 > MFC after: 2 weeks > --- > lib/libc/gen/syslog.c | 54 +++++++++++++++++++++++++++++++++++++++++++= +++++--- > 1 file changed, 51 insertions(+), 3 deletions(-) > > - (void)fprintf(fp, "%d ", getpid()); > + if (LogPid =3D=3D -1) > + LogPid =3D getpid(); I believe this introduced unexpected behaviour for syslog(). If we log so= mething prior to fork()ing we=E2=80=99ll keep logging with the old pid. T= hat=E2=80=99s a fairly common pattern for daemonising code, and it=E2=80=99= s something openvpn ran into: https://github.com/OpenVPN/openvpn/issues/1= 98 Best regards, Kristof