Bug 213742

Summary: /etc/crontab $PATH modification
Product: Base System Reporter: Ben RUBSON <ben.rubson>
Component: confAssignee: Warner Losh <imp>
Status: Closed FIXED    
Severity: Affects Many People CC: koobs
Priority: --- Keywords: patch
Version: CURRENTFlags: koobs: mfc-stable11+
Hardware: Any   
OS: Any   

Description Ben RUBSON 2016-10-24 13:31:08 UTC
Hello,

crontab(5) :
Several environment variables are set up automatically by the cron(8) daemon.  SHELL is set to /bin/sh, PATH is set to
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin,
and LOGNAME and HOME are set from the /etc/passwd line of the crontab's owner.

/etc/crontab :
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin

I then think that /etc/crontab should set :
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin

(I also think that /etc is no more needed in $PATH since this commit :
https://github.com/freebsd/freebsd/commit/77f8fc2dc8a4b898c69e145ecb5c0e72aab05968)

It would be more coherent, and also more convenient, without being more risky.

Thank you very much !

Ben
Comment 1 Ben RUBSON 2017-08-24 15:23:35 UTC
Hi,
Any thoughts about this ?
Many thx !
Ben
Comment 2 Ben RUBSON 2018-06-09 10:56:33 UTC
See https://github.com/freebsd/freebsd/pull/155 for a fix.
Thank you !
Comment 3 Ben RUBSON 2018-06-10 07:40:01 UTC
Fix merged with r334909, thank you Warner Losh !
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2018-12-14 11:30:26 UTC
Assign to committer that resolved.

Unsure if this was eventually MFC'd to stable/11, but appears to be a good candidate.

@Warner, can we re-open this and merge it there? [1]

[1] https://twitter.com/socrueldotnu/status/1073538274449391616
Comment 5 Warner Losh freebsd_committer freebsd_triage 2018-12-14 21:30:48 UTC
(In reply to Kubilay Kocak from comment #4)
I'd forgotten about this. MFC'd now.
Comment 6 Warner Losh freebsd_committer freebsd_triage 2018-12-14 21:31:07 UTC
MFC'd in r342103