File sudo-secure_path.diff of Package sudo.import5544
Index: pathnames.h.in
===================================================================
--- pathnames.h.in.orig
+++ pathnames.h.in
@@ -44,7 +44,7 @@
#endif /* _PATH_DEVNULL */
#ifndef _PATH_DEFPATH
-#define _PATH_DEFPATH "/usr/bin:/bin"
+#define _PATH_DEFPATH "/usr/bin:/bin:/usr/sbin:/sbin"
#endif /* _PATH_DEFPATH */
#ifndef _PATH_STDPATH
Index: env.c
===================================================================
--- env.c.orig
+++ env.c
@@ -756,7 +756,7 @@ rebuild_env(noexec)
}
}
/* Replace the PATH envariable with a secure one? */
- if (def_secure_path && !user_is_exempt()) {
+ if (def_secure_path && !user_is_exempt() && def_env_reset) {
sudo_setenv("PATH", def_secure_path, TRUE);
SET(didvar, DID_PATH);
}