From nobody Tue Jan 03 08:58:51 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 4NmRVM5cS1z2pBhs; Tue, 3 Jan 2023 08:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NmRVM4xH9z48ld; Tue, 3 Jan 2023 08:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672736331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lx1zKwBaRJA2+Ti2ZGWMDiZdyHThjDNNObFvLKj+xxU=; b=wBvU9BOQb1QU+bPLD6cb00M6etjxSWb8+aT2kucaDPnifv4+coO/8hCpix0CILvaGd62/b CW2oD6BSxp8VJmCE6CNTzSG98mw0vfajA4A4GD7Be83qHQNhh2JjQHxhtLbihGAw3ESW7l MxXIMYl2rqFj77FUBOzoof3bdW0NPNpbM5IJF8c1m22mjW47f9tiOt+Dt/EjQ8+Xn0OlS+ 9cKsrg2AxrWwh3ls9MUlIxhOV3PzAiJ4zaTLCsaiRE1hnGg3oNd5P16zBT+MYYbxvFMJy5 8wkgzRzTtrH2aVwwj4I6XkSqRfeJyO0YV26TEm1+gmiGlyS5LtGq8PsDJpxgqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672736331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lx1zKwBaRJA2+Ti2ZGWMDiZdyHThjDNNObFvLKj+xxU=; b=bfzVnxCUhpidX+dMfOieshPadxid8Tc54Uc48pOFAFcaLCK7lRj1/UUKgWKysipgyBh2cw Uc7QBBhyIe9F9278+qPBXEcPu+3U+euZAW42+RXHz5C1xqkwDzbvtHF1fXyDZegqxozP3v xYCnkSI0nngshvARY18uxwpmlF9t9Lf3q0oeDEOOla+zO5ESnouRGoUxN4prWpLgZeKTxn KZ5k0pH/K8fDCihlR+ZHQ312KkQx3oL5zU+o+5BLOvW3YFDfheFzfi7cGiLpTGkmCkfjev uyxF+KUqvMgrMvJpWkGnvTkJyaKIG9nu/VFRgsj1st4e6+jD9Ki+qQjUxgojQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672736331; a=rsa-sha256; cv=none; b=ifVjLxdh5TMLNPs1B8XO/dWI73mEQUGcWCMOZOG6pHlu5dlTgJG0RJXYfhKkAC+cxCrbGl 8GY740ZS6iSUY5mjOs0DPnU3uBnbdj3CGEQnIl0Vk+Q0/MsL9y2Fido+3mGL77SGLh410G JlqN+lFDQD29DeqBDEg/sucKZmwYGKUk2Vw0F+Lxtd+UNukS8QAIhFZFOjk9Nr0D7R2Gk8 l6u4qvCn0ChHRV8pDpaODFxb+UT5yE8LX3RW5p+moHOIAsr4V686a+C3185ZEpBnDKSWAt 2vqRZLuBJQ3NLpRNPU8Y6VKg86hztccWzHkXonD+Oym4eIhxWN1nn401KyVIVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NmRVM3zqXzQXm; Tue, 3 Jan 2023 08:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3038wpqO045328; Tue, 3 Jan 2023 08:58:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3038wpF9045327; Tue, 3 Jan 2023 08:58:51 GMT (envelope-from git) Date: Tue, 3 Jan 2023 08:58:51 GMT Message-Id: <202301030858.3038wpF9045327@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 2ce3ef550350 - main - syslog: fix PID of forking process 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ce3ef55035093cac7839e71e9ff91f5562ebc29 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=2ce3ef55035093cac7839e71e9ff91f5562ebc29 commit 2ce3ef55035093cac7839e71e9ff91f5562ebc29 Author: Eugene Grosbein AuthorDate: 2023-01-03 08:53:47 +0000 Commit: Eugene Grosbein CommitDate: 2023-01-03 08:58:36 +0000 syslog: fix PID of forking process Do not cache PID for a process that does not fabricate it, calls openlog() before forking and does not call exec() thereafter. PR: 268666 Fixes: e9ae9fa93745669b7dd0341d333257ad6cfe8e37 Tested by: kp MFC after: 3 days --- lib/libc/gen/syslog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index 2424cef78dd7..08bdfdbeb1e7 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -218,7 +218,7 @@ vsyslog1(int pri, const char *fmt, va_list ap) * specified, as it provides valuable information. Many * applications tend not to use this, even though they should. */ - if (LogPid == -1) + if (LogTagLength <= 0) LogPid = getpid(); (void)fprintf(fp, "%d ", (int)LogPid); /* Message ID. */