crond: change default $PATH to something reasonable (ALT#25846)
Change default path for uid != 0 to /usr/local/bin:/usr/bin:/bin:$HOME/bin Change default path for uid == 0 to /usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:$HOME/bin
This commit is contained in:
parent
e8e5e13b48
commit
c818bfcc82
15
alt/vixie-cron-4.1.20060426-alt-path.patch
Normal file
15
alt/vixie-cron-4.1.20060426-alt-path.patch
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
--- vixie-cron-4.1.20060426/usr.sbin/cron/entry.c
|
||||||
|
+++ vixie-cron-4.1.20060426/usr.sbin/cron/entry.c
|
||||||
|
@@ -306,8 +306,10 @@
|
||||||
|
#ifndef LOGIN_CAP
|
||||||
|
/* If login.conf is in use we will get the default PATH later. */
|
||||||
|
if (!env_get("PATH", e->envp)) {
|
||||||
|
- if (snprintf(envstr, sizeof envstr, "PATH=%s", _PATH_DEFPATH) >=
|
||||||
|
- sizeof(envstr))
|
||||||
|
+ if (snprintf(envstr, sizeof(envstr), "PATH=%s:%s/bin",
|
||||||
|
+ (pw->pw_uid ? "/usr/local/bin:/usr/bin:/bin" :
|
||||||
|
+ "/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin"),
|
||||||
|
+ pw->pw_dir) >= sizeof(envstr))
|
||||||
|
log_it("CRON", getpid(), "error", "can't set PATH");
|
||||||
|
else {
|
||||||
|
if ((tenvp = env_set(e->envp, envstr)) == NULL) {
|
@ -37,7 +37,8 @@ Patch12: vixie-cron-4.1.20040916-alt-children.patch
|
|||||||
Patch13: vixie-cron-4.1.20060426-owl-tmp.patch
|
Patch13: vixie-cron-4.1.20060426-owl-tmp.patch
|
||||||
Patch14: vixie-cron-4.1.20040916-alt-setproctitle.patch
|
Patch14: vixie-cron-4.1.20040916-alt-setproctitle.patch
|
||||||
Patch15: vixie-cron-4.1.20060426-alt-crontab-list.patch
|
Patch15: vixie-cron-4.1.20060426-alt-crontab-list.patch
|
||||||
Patch16: vixie-cron-4.1.20060426-alt-selinux.patch
|
Patch16: vixie-cron-4.1.20060426-alt-path.patch
|
||||||
|
Patch17: vixie-cron-4.1.20060426-alt-selinux.patch
|
||||||
|
|
||||||
BuildRequires: libpam-devel, setproctitle-devel
|
BuildRequires: libpam-devel, setproctitle-devel
|
||||||
%{?_with_selinux:BuildRequires: libselinux-devel}
|
%{?_with_selinux:BuildRequires: libselinux-devel}
|
||||||
@ -64,7 +65,8 @@ modifications by the NetBSD, OpenBSD, Red Hat, Owl and ALT teams.
|
|||||||
%patch13 -p1
|
%patch13 -p1
|
||||||
%patch14 -p1
|
%patch14 -p1
|
||||||
%patch15 -p1
|
%patch15 -p1
|
||||||
%{?_with_selinux:%patch16 -p1}
|
%patch16 -p1
|
||||||
|
%{?_with_selinux:%patch17 -p1}
|
||||||
|
|
||||||
sed -i 's/^\(static char const rcsid\[\] =\).*/\1 "%name-%version-%release";/' \
|
sed -i 's/^\(static char const rcsid\[\] =\).*/\1 "%name-%version-%release";/' \
|
||||||
usr.sbin/cron/crontab.c
|
usr.sbin/cron/crontab.c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user