summaryrefslogtreecommitdiff
path: root/find_path.c
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@courtesan.com>1998-11-14 00:21:40 +0000
committerTodd C. Miller <Todd.Miller@courtesan.com>1998-11-14 00:21:40 +0000
commitd90abfd3cfa4264f0602a193ecfa1d6b3263b6d8 (patch)
tree1edcb07a27febf917f9f13a845c07f2eef0e8bdb /find_path.c
parent20c50a539a0bb334cccc3b29e2476da1cd32fd7d (diff)
downloadsudo-d90abfd3cfa4264f0602a193ecfa1d6b3263b6d8.tar.gz
return NOT_FOUND if given fully qualified path and it does not exist
previously it would perror(ENOENT) which bypasses the option to not leak path info
Diffstat (limited to 'find_path.c')
-rw-r--r--find_path.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/find_path.c b/find_path.c
index 08c4fbd0b..bdc93c086 100644
--- a/find_path.c
+++ b/find_path.c
@@ -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);
}
/*