Fix a bug where HOME was not allowed to be overridden by an user's crontab
as crontab(5) states it can be. This is supported by all vixie-cron derived implementations; not sure why FreeBSD was any different. PR: bin/106442 MFC after: 2 weeks
This commit is contained in:
parent
486a941418
commit
2ba44ac557
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=167328
@ -351,14 +351,16 @@ load_entry(file, error_func, pw, envp)
|
||||
goto eof;
|
||||
}
|
||||
}
|
||||
prev_env = e->envp;
|
||||
sprintf(envstr, "HOME=%s", pw->pw_dir);
|
||||
e->envp = env_set(e->envp, envstr);
|
||||
if (e->envp == NULL) {
|
||||
warn("env_set(%s)", envstr);
|
||||
env_free(prev_env);
|
||||
ecode = e_mem;
|
||||
goto eof;
|
||||
if (!env_get("HOME", e->envp)) {
|
||||
prev_env = e->envp;
|
||||
sprintf(envstr, "HOME=%s", pw->pw_dir);
|
||||
e->envp = env_set(e->envp, envstr);
|
||||
if (e->envp == NULL) {
|
||||
warn("env_set(%s)", envstr);
|
||||
env_free(prev_env);
|
||||
ecode = e_mem;
|
||||
goto eof;
|
||||
}
|
||||
}
|
||||
if (!env_get("PATH", e->envp)) {
|
||||
prev_env = e->envp;
|
||||
|
Loading…
Reference in New Issue
Block a user