HomeFreeBSD

Fix 'calendar -a' in several ways.

Description

Fix 'calendar -a' in several ways.

o Do not run any iconv() processing in -a. The locale of root user is not

what is desired by most of the users who receive their calendar mail.
Just assume that users store their calendars in a format that is readable
to them. This fixes regression from r344340.

o fork() and setusercontext(LOGIN_SETALL) for every user. This makes LANG

set inside a calendar file mostly excessive, as we will pick up user's
login class LANG.

o This also executes complex function cal() that parses user owned files

with appropriate user privileges.
Previously it was run with privileges dropped only temporary for execution
of cal(), and fully dropped only before invoking sendmail (see r22473).

Reviewed by: bapt (older version of patch)

Details

Provenance
glebiusAuthored on Sep 10 2019, 4:21 AM
Parents
rG1e01d2dcacb5: Remove pointless playing with LC_TIME, which should have been done in r205821.
Branches
Unknown
Tags
Unknown