HomeFreeBSD

cron: respect PATH from login.conf

Description

cron: respect PATH from login.conf

As a followup to the use of login.conf environment vars (other than PATH) in
cron, this patch adds PATH (and HOME) to the list of login.conf settings
respected.

The new logic is as follows:

  1. SHELL is always _PATH_BSHELL unless explicitly overridden in the crontab

file itself; no other settings are respected. This is unchanged.

  1. PATH is taken from the first of: crontab file, login.conf, _PATH_DEFPATH
  1. HOME is taken from the first of: crontab file, login.conf, passwd entry,

unset

  1. The current directory for invoking the command is taken from the crontab

file's value of HOME (existing behavior), or the passwd entry, but not
anywhere else (so it might not equal HOME if that was set in login.conf).

Submitted by: Andrew Gierth <andrew_tao173.riddles.org.uk>
Reviewed by: sigsys_gmail.com
Differential Revision: https://reviews.freebsd.org/D23597

Details

Provenance
kevansAuthored on
Reviewer
sigsys_gmail.com
Differential Revision
D23597: Respect PATH from login.conf in cron.
Parents
rS359433: bmake: fix -fno-common build
Branches
Unknown
Tags
Unknown