From nobody Wed Sep 4 20:30:30 2024 X-Original-To: bugs@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 4WzYyx6Qbrz5VKvP for ; Wed, 04 Sep 2024 20:30:33 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzYyw2ZWNz4Lsv for ; Wed, 4 Sep 2024 20:30:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725481832; a=rsa-sha256; cv=none; b=H/aOBMmeGXDpzVtnbnc4OGfG5G+DktiBr0cLE/UmHGFFshY7MZywqOriN3RQ4E0pxzRUwl cuqc7tXIWbx9jcHrlS4QqITd4XupnfmEIk51VL+hhr4xIusP0kl/VDNnO5V2qIdvndsoeG veUQ9cfrEQu5bZj3tdjeC9Q+xC+Y26aboy0myUMNdT2jxjr0r8XtpMeTcWbncOt4OrnCl4 sa/U+czCFT6ESzcmyPUBD06wSAvnqRtPV0s5SbQX/WdBy2XoJfCSYyPbZMAgjTWa35Csz0 ketgG2UN9x74fFNFQaYRFKx9Lp43U9oHDBSKxH230AUpUKlhVeopwBt89csEYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725481832; 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: in-reply-to:in-reply-to:references:references; bh=tjli8actPqn09zBJrbx7AJ2CG2xYdc0NubepP5q1EDA=; b=gV/jRytv5M2O0Rvl/q4DMHPHhJ+Um5C4AOYkhpFcZrqX9AP/HgVUpbrp0RHWk5RUyU8C3Q GjzEBmAnBjHOdfsPkHByjmkHnbbDC63HO9dCrzMWCwu05WRdDWFDF4er3RGIeOKL+Rem4K 1Xtm0T7nC9Qaz9WkW9To2d3Y2t6juhYXzZplrYPvlvp6Qwdcj+xxcdcA5oHfe3RfD6OKv3 JDv7vtx+yOIV3sGvOHBzUSITlg1xoA4hRd2ERY7XmeEnBVzAklWgE43FxcKbFgXNWGoZRP GPocD0hWh1YrFNvezr8RWhztkPE6V7AEBtBrEuJcK4mEoUaV+fzaKoFLnHyotA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4WzYyw29qhzfkV for ; Wed, 4 Sep 2024 20:30:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 484KUW3X068571 for ; Wed, 4 Sep 2024 20:30:32 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 484KUW3D068558 for bugs@FreeBSD.org; Wed, 4 Sep 2024 20:30:32 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 280418] calendar -a trashes parent's pgrp login setting Date: Wed, 04 Sep 2024 20:30:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 14.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: kevans@freebsd.org X-Bugzilla-Flags: mfc-stable14? mfc-stable13? needs_errata? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280418 --- Comment #14 from commit-hook@FreeBSD.org --- A commit in branch releng/13.3 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3Deab94c0fbb782f1d849981d0dde2106ec= 9bc8df3 commit eab94c0fbb782f1d849981d0dde2106ec9bc8df3 Author: Kyle Evans AuthorDate: 2024-08-05 18:43:56 +0000 Commit: Ed Maste CommitDate: 2024-09-04 20:28:41 +0000 calendar: don't setlogin(2) in the -a user handlers As of e67975d331 ("Fix 'calendar -a' in several ways."), `calendar -a` will now fork off a new process for each user and do all of its own processing in the user's own context. As a side-effect, calendar(1) started calling setlogin(2) in each of the forked processes and inadvertently hijacked the login name for the session it was running under, which was typically not a fresh session but rather that of whatever cron/periodic run spawned it. Thus, daily and security e-mails started coming from completely arbitrary user. We could create a new session, but it appears that nothing calendar(1) does really needs the login name to be clobbered; opt to just avoid the setlogin(2) call entirely rather than incur the overhead of a new session for each process. PR: 280418 Reviewed by: des, olce Fixes: e67975d331 ("Fix 'calendar -a' in several ways.") (cherry picked from commit 6cb8b61efe8899ee9194563108d0ae90c1eb89e3) (cherry picked from commit 3a9010c98b3d9676307fac20d42cdd3cfd4bc46d) Approved by: so usr.bin/calendar/calendar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --=20 You are receiving this mail because: You are on the CC list for the bug.=