opnsense-src/usr.bin/calendar
Kyle Evans 33708452aa 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)
2024-08-08 14:59:21 -05:00
..
calendars Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
calendar.1 calendar: correct the search order for files 2024-01-02 22:47:22 -06:00
calendar.c calendar: don't setlogin(2) in the -a user handlers 2024-08-08 14:59:21 -05:00
calendar.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
dates.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
day.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
events.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
io.c calendar: correct the search order for files 2024-01-02 22:47:22 -06:00
locale.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ostern.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
parsedata.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
paskha.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
pathnames.h Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00
pom.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
sunpos.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00