From nobody Mon Aug 5 18:44:11 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 4Wd5243q5yz5SVVy for ; Mon, 05 Aug 2024 18:44:12 +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 4Wd5242jzNz4v0C for ; Mon, 5 Aug 2024 18:44:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722883452; a=rsa-sha256; cv=none; b=II+Q96ymJniyPOBnhAsRRnQooGY6GpGrLvQrXP25pFSD4ENeDw32A5K3kk8z3yf39bscjH 2xhL2+txU/c1I/u52d8PzCv80vF+2bFn6k1qSiepkqURTJN5/zaJBebt+zL0R495PnC6Te bqcSa98J7D01/KRQmJLMYdTwADYQyyx27Pa5LSu3bWAu5Rp50Dmr6KcZIWZO21djF+2LmS u1v7Z3njrevsNiiLeaA+gJskCbf+Jc5ewfAxNaC22pXNIoucAbg4Hn2qWD8W7JeqOZ449u 96PcSdBRT7IoQQEX0IiP80++guCZCKwXLKhRe/w8lvPXnyzF9j50L7+H6UMt6Q== 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=1722883452; 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=La7H9vtAtsTAy64LalZQxhjvb6ToAj0BUlUkKRz1qoI=; b=BuMMbbbdSvyX5t1Le/gP2bks96A5v9Sb3DmSmGPTp6CDZ8zcjXeIfQvi8tGuMxCTnFErSF 36sNRBJ3rdDoKH8R5SBHMvFDzFwA1720AIub9hP4JTyXb0vSfJ0vf/PeAqYH73OWaA8CYB u5Wg/Vn91fTs4pjfkAHujXBWaIkHCKkPVh3+gf2QzgcyyevoBtwmjGKJXpyIEIkrvpbxoC dHMZSERU+0QHOdhla4JkIUCMET+nlzR1zOAnJVE3rQZPr9CvD8EXUTWYAaC1y/7l1McS7+ qTnycFYn/79vKVPt92jRzjfQlSWFzvG4Fp2Se+ZS62kM/nuhgsFUZFRu6b9Dpw== 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 4Wd5242FSjzZmx for ; Mon, 5 Aug 2024 18:44:12 +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 475IiCDa096592 for ; Mon, 5 Aug 2024 18:44:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 475IiCt1096591 for bugs@FreeBSD.org; Mon, 5 Aug 2024 18:44:12 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: Mon, 05 Aug 2024 18:44:11 +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: 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 #4 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D6cb8b61efe8899ee9194563108d0ae90c= 1eb89e3 commit 6cb8b61efe8899ee9194563108d0ae90c1eb89e3 Author: Kyle Evans AuthorDate: 2024-08-05 18:43:56 +0000 Commit: Kyle Evans CommitDate: 2024-08-05 18:43:56 +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.") Differential Revision: https://reviews.freebsd.org/D46095 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.=