diff --git a/pathnames.h.in b/pathnames.h.in index d6eb6e466..4e6cc078d 100644 --- a/pathnames.h.in +++ b/pathnames.h.in @@ -43,6 +43,10 @@ #define _PATH_DEFPATH "/usr/bin:/bin" #endif /* _PATH_DEFPATH */ +#ifndef _PATH_STDPATH +#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" +#endif /* _PATH_STDPATH */ + #ifndef _PATH_ENVIRONMENT #define _PATH_ENVIRONMENT "/etc/environment" #endif /* _PATH_ENVIRONMENT */ diff --git a/plugins/sudoers/env.c b/plugins/sudoers/env.c index 99ef0ff57..c7562590c 100644 --- a/plugins/sudoers/env.c +++ b/plugins/sudoers/env.c @@ -572,7 +572,7 @@ rebuild_env(int noexec) if (!ISSET(didvar, DID_TERM)) sudo_putenv("TERM=unknown", FALSE, FALSE); if (!ISSET(didvar, DID_PATH)) - sudo_setenv("PATH", _PATH_DEFPATH, FALSE); + sudo_setenv("PATH", _PATH_STDPATH, FALSE); /* * Preload a noexec file? For a list of LD_PRELOAD-alikes, see diff --git a/plugins/sudoers/logging.c b/plugins/sudoers/logging.c index 071c84cd5..0cacc92cb 100644 --- a/plugins/sudoers/logging.c +++ b/plugins/sudoers/logging.c @@ -404,7 +404,7 @@ send_mail(const char *fmt, ...) #ifndef NO_ROOT_MAILER static char *root_envp[] = { "HOME=/", - "PATH=/usr/bin:/bin", + "PATH=/usr/bin:/bin:/usr/sbin:/sbin", "LOGNAME=root", "USERNAME=root", "USER=root",