Summary: | suggeted improvement for crontab(1)'s newly created files | ||
---|---|---|---|
Product: | Base System | Reporter: | Mason Loring Bliss <mason> |
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Closed Works As Intended | ||
Severity: | Affects Some People | CC: | jilles |
Priority: | --- | ||
Version: | 10.2-RELEASE | ||
Hardware: | Any | ||
OS: | Any |
Description
Mason Loring Bliss
2015-11-25 17:53:35 UTC
This is a week old and has not been triaged. Perhaps _PATH_DEFPATH in include/paths.h should be changed to /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin, avoiding much of the problem in the first place (except for ~/bin, /usr/local/bin before /usr/bin, etc.). Due to difficulties getting the value of _PATH_DEFPATH, the starter file will have to be defined in crontab.c. Expanding the path would obviate the problem, but it would also change the behaviour for regular users who arguably should have to explicitly add /sbin, /usr/sbin, and similar. I'd be happy with expanding the path. My idea of a default file with a commented out PATH seemed like the least-invasive option - users with established crontabs wouldn't be impacted at all, and new crontabs would have a small, subtle reminder that their PATH isn't necessarily the same as it was in the shell they used to invoke crontab(1). Regardless of whate solution you folks decide is appropriate, thank you for your time and work. A commit references this bug: Author: jilles Date: Tue Jan 5 16:21:21 UTC 2016 New revision: 293204 URL: https://svnweb.freebsd.org/changeset/base/293204 Log: Add sbin and /usr/local directories to _PATH_DEFPATH. Set _PATH_DEFPATH to /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin. This is the path in the default class in the default /etc/login.conf, excluding ~/bin which would not be expanded properly in a string constant. For normal logins, _PATH_DEFPATH is overridden by /etc/login.conf, ~/.login_conf or shell startup files. _PATH_DEFPATH is still used as a default by execlp(), execvp(), posix_spawnp() and sh if PATH is not set, and by cron. Especially the latter is a common trap (most recently in PR 204813). PR: 204813 Reviewed by: secteam (delphij), alfred Changes: head/include/paths.h head/lib/libc/gen/exec.3 head/lib/libc/gen/posix_spawn.3 head/usr.sbin/cron/crontab/crontab.5 FreeBSD is better off as it is. Sorry for the bother. |