Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Sep 2024 20:54:52 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 280418] calendar -a trashes parent's pgrp login setting
Message-ID:  <bug-280418-227-6XiAllc7wN@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-280418-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-280418-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280418

--- Comment #15 from commit-hook@FreeBSD.org ---
A commit in branch releng/14.0 references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=3Dd94dbaa516e0c7fb05a52f1c760201654=
82b7bf0

commit d94dbaa516e0c7fb05a52f1c76020165482b7bf0
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2024-08-05 18:43:56 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-09-04 20:31:04 +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 33708452aaabca205d81eceb83e0813e5882815c)

    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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-280418-227-6XiAllc7wN>