From: Todd C. Miller Date: Tue, 10 Nov 1998 00:15:04 +0000 (+0000) Subject: add "ignoring foo found in ." for auth successful case X-Git-Tag: SUDO_1_5_7~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=53969f978fdce1321e63aa5be41bf3b7143688da;p=sudo add "ignoring foo found in ." for auth successful case --- diff --git a/sudo.c b/sudo.c index ec249279e..22ecfb1ad 100644 --- a/sudo.c +++ b/sudo.c @@ -312,9 +312,12 @@ int main(argc, argv) case VALIDATE_OK_NOPASS: /* finally tell the user if the command did not exist */ - if (cmnd_status != FOUND) { + if (cmnd_status == NOT_FOUND_DOT) { + (void) fprintf(stderr, "%s: ignoring `%s' found in '.'\nUse `sudo ./%s' if this is the `%s' you wish to run.\n", Argv[0], cmnd, cmnd, cmnd); + exit(1); + } else if (cmnd_status == NOT_FOUND) { (void) fprintf(stderr, "%s: %s: command not found\n", Argv[0], - cmnd); + cmnd); exit(1); } @@ -377,7 +380,7 @@ int main(argc, argv) #ifndef DONT_LEAK_PATH_INFO if (cmnd_status == NOT_FOUND_DOT) - (void) fprintf(stderr, "%s: ignoring %s found in '.'\nUse `sudo ./%s' if this is the %s you wish to run.\n", Argv[0], cmnd, cmnd, cmnd); + (void) fprintf(stderr, "%s: ignoring `%s' found in '.'\nUse `sudo ./%s' if this is the `%s' you wish to run.\n", Argv[0], cmnd, cmnd, cmnd); else if (cmnd_status == NOT_FOUND) (void) fprintf(stderr, "%s: %s: command not found\n", Argv[0], cmnd);