From 5b9e39ac8712c9d5874a07d3284a73064459d7d7 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 12 Jul 2010 18:07:52 -0400 Subject: [PATCH] Use _PATH_STDPATH instead of _PATH_DEFPATH --- pathnames.h.in | 4 ++++ plugins/sudoers/env.c | 2 +- plugins/sudoers/logging.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) 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", -- 2.40.0