Bug 213742 - /etc/crontab $PATH modification
Summary: /etc/crontab $PATH modification
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Warner Losh
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-10-24 13:31 UTC by Ben RUBSON
Modified: 2018-12-15 04:49 UTC (History)
1 user (show)

See Also:
koobs: mfc-stable11+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 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 2018-12-14 21:31:07 UTC
MFC'd in r342103