From: Todd C. Miller Date: Mon, 31 Jan 1994 00:42:26 +0000 (+0000) Subject: more verbose eror messages X-Git-Tag: SUDO_1_3_0~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a96a43a54b159daf2bd43f293ec6781f7fec5e7;p=sudo more verbose eror messages --- diff --git a/find_path.c b/find_path.c index ae3ffc981..2808bf44e 100644 --- a/find_path.c +++ b/find_path.c @@ -142,8 +142,10 @@ char *find_path(file) if (!statfailed && (statbuf.st_mode & 0000111)) return (qualify(fn)); else if (statfailed && errno != ENOENT && errno != ENOTDIR && - errno != EINVAL) - perror("find_path: stat"); + errno != EINVAL) { + fprintf(stderr, "sudo: Can't stat %s", fn); + perror(""); + } path = n + 1; @@ -163,7 +165,8 @@ char *find_path(file) return (qualify(fn)); else if (statfailed && errno != ENOENT && errno != ENOTDIR && errno != EINVAL) { - perror("find_path: stat"); + fprintf(stderr, "sudo: Can't stat %s: ", fn); + perror(""); return (NULL); } } @@ -193,8 +196,10 @@ char *qualify(n) * is it a bogus path? */ if (stat(n, &statbuf)) { - if (errno != ENOENT) - perror("qualify: stat"); + if (errno != ENOENT) { + fprintf(stderr, "sudo: Can't stat %s: ", n); + perror(""); + } return (NULL); } @@ -249,7 +254,8 @@ char *qualify(n) * check for symbolic links */ if (lstat(full, &statbuf)) { - perror("qualify: lstat"); + fprintf(stderr, "sudo: Can't lstat %s: ", full); + perror(""); return (NULL); }