From nobody Tue Jan 3 06:55:11 2023 X-Original-To: dev-commits-src-all@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 4NmNlp6pSLz2nvGR; Tue, 3 Jan 2023 06:55:18 +0000 (UTC) (envelope-from yuri@aetern.org) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4NmNlp4dxpz3whq; Tue, 3 Jan 2023 06:55:18 +0000 (UTC) (envelope-from yuri@aetern.org) Authentication-Results: mx1.freebsd.org; none Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 0EF333200986; Tue, 3 Jan 2023 01:55:15 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 03 Jan 2023 01:55:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aetern.org; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1672728915; x= 1672815315; bh=XXlpeOAYHjloSux+GGpMVV0FpeJXSTwNuGyTprdTZf0=; b=k oLPfJxjaE7uPC2Na5NUeZFmAzEnUaouwgMaWNi/9i1+Tubx4+r/vCju1wXoke4oT +92waVD3/7yXynqiEMGY4AVpipfHxxfOiDkjVgBlZJ5ntTuw+JgQuWY+Inc8gTiw 4EslgchCR1pJHmIgAjqOX27bh65/c6D/O9tNCPRJo870/mbUc4j40ZS5Y0SXZUxR vWYlmDtaqo1dFgpypG1sncGKlQXjl+8JyrZnjxZ0KXTcJxxdVS2ZbUaoNqNvAk4r EYGn0N8sEET/QQF8/4TOm5Gxi0SQZOc2XShyF+NVIBs74nWdGjSeRtZ+WHO2acVJ IFwouZJivB3g4/V/6b5Hw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1672728915; x= 1672815315; bh=XXlpeOAYHjloSux+GGpMVV0FpeJXSTwNuGyTprdTZf0=; b=M 7U1MLh2FuI+C7CnW7byU4lpobloBT5tYnEr72k1/nJ0oE/7e8/La2o9YH0csMH3a dheeuHgtBFx8w59sjb2nW3/+paZM32v4MecQ+dvm2B5BkwTLQwW8q8Z7u59YC4T8 i3V2myjOCgbd84iT0WTzB7g53WEER6ZcJZFiiwDrnq8Hjy9yiJw1jS4iTdNSu1ya c5uRlBkVYDYSiLex2k715smwVDAp5IxRP1tGEXPFy3hDX3w2sObNGgfGqZsTvsSn /wpHCr0uZ0AQoxXcRYiW52rN4DAPpz46zBvFvLcQ462+QjihjrM2eJMffeXGt5YW CeWdRm5MdLe0paTugvNJQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrjeefgddutdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpegjuhhr ihcuoeihuhhrihesrggvthgvrhhnrdhorhhgqeenucggtffrrghtthgvrhhnpefgveegie dvgeegheegteeileeiudeiffeggfefieefhfduvdelffejfefflefhjeenucffohhmrghi nhepfhhrvggvsghsugdrohhrghdpghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephihurhhisegrvghtvghrnhdrohhr gh X-ME-Proxy: Feedback-ID: i0d79475b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 3 Jan 2023 01:55:14 -0500 (EST) Message-ID: <44f28dfb-0399-3ab6-b1f7-b72aeb59d6f3@aetern.org> Date: Tue, 3 Jan 2023 07:55:11 +0100 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: git: e9ae9fa93745 - main - syslog(3): unbreak log generation using fabricated PID Content-Language: en-US To: Kristof Provost , Eugene Grosbein Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202208082230.278MUYZd078396@gitrepo.freebsd.org> From: Yuri In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4NmNlp4dxpz3whq X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:29838, ipnet:64.147.123.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Kristof Provost wrote: > 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=e9ae9fa93745669b7dd0341d333257ad6cfe8e37 >> >> 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 == -1) >> + LogPid = getpid(); > > I believe this introduced unexpected behaviour for syslog(). If we log something prior to fork()ing we’ll keep logging with the old pid. That’s a fairly common pattern for daemonising code, and it’s something openvpn ran into: https://github.com/OpenVPN/openvpn/issues/198 And likely https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268666.