]> granicus.if.org Git - sudo/commitdiff
fixed SECURE_PATH
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 15 Jan 1996 16:34:23 +0000 (16:34 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 15 Jan 1996 16:34:23 +0000 (16:34 +0000)
sudo.c

diff --git a/sudo.c b/sudo.c
index bb5ad5938f950e98c0f0419202f1a1c5de8514a5..11e6017b6abaea528bb025c00591c4227a7de872 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -246,6 +246,12 @@ int main(argc, argv)
        exit(1);
     }
 
+#ifdef SECURE_PATH
+    /* replace the PATH envariable with a secure one */
+    if (!user_is_exempt())
+       sudo_setenv("PATH", SECURE_PATH);
+#endif /* SECURE_PATH */
+
     if ((sudo_mode & MODE_RUN)) {
        load_cmnd(sudo_mode);   /* load the cmnd global variable */
     } else if (sudo_mode == MODE_KILL) {
@@ -593,12 +599,6 @@ static void add_env()
 {
     char idstr[MAX_UID_T_LEN + 1];
 
-#ifdef SECURE_PATH
-    /* replace the PATH envariable with a secure one */
-    if (!user_is_exempt())
-       sudo_setenv("PATH", SECURE_PATH);
-#endif /* SECURE_PATH */
-
     /* add the SUDO_COMMAND envariable */
     if (sudo_setenv("SUDO_COMMAND", cmnd)) {
        perror("malloc");