]> granicus.if.org Git - sudo/commitdiff
return NOT_FOUND if given fully qualified path and it does not exist
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 14 Nov 1998 00:21:40 +0000 (00:21 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 14 Nov 1998 00:21:40 +0000 (00:21 +0000)
previously it would perror(ENOENT) which bypasses the option to not
leak path info

find_path.c

index 08c4fbd0bf1964c03e12cdc9ba897bdeeea4c1a5..bdc93c08665627df967aea6517fb6c5332e2a815 100644 (file)
@@ -114,19 +114,14 @@ int find_path(infile, outfile)
     /*
      * If we were given a fully qualified or relative path
      * there is no need to look at PATH.
-     * We really want to fall back if !sudo_goodpath() but then
-     * the error is "not found" -- this way we get the correct error.
      */
     if (strchr(infile, '/')) {
        (void) strcpy(command, infile);
        if (sudo_goodpath(command)) {
            *outfile = command;
            return(FOUND);
-       } else {
-           (void) fprintf(stderr, "%s: %s: ", Argv[0], command);
-           perror("");
-           exit(1);
-       }
+       } else
+           return(NOT_FOUND);
     }
 
     /*