more verbose eror messages

This commit is contained in:
Todd C. Miller
1994-01-31 00:42:26 +00:00
parent 814b02fb2b
commit 7a96a43a54

View File

@@ -142,8 +142,10 @@ char *find_path(file)
if (!statfailed && (statbuf.st_mode & 0000111)) if (!statfailed && (statbuf.st_mode & 0000111))
return (qualify(fn)); return (qualify(fn));
else if (statfailed && errno != ENOENT && errno != ENOTDIR && else if (statfailed && errno != ENOENT && errno != ENOTDIR &&
errno != EINVAL) errno != EINVAL) {
perror("find_path: stat"); fprintf(stderr, "sudo: Can't stat %s", fn);
perror("");
}
path = n + 1; path = n + 1;
@@ -163,7 +165,8 @@ char *find_path(file)
return (qualify(fn)); return (qualify(fn));
else if (statfailed && errno != ENOENT && errno != ENOTDIR && else if (statfailed && errno != ENOENT && errno != ENOTDIR &&
errno != EINVAL) { errno != EINVAL) {
perror("find_path: stat"); fprintf(stderr, "sudo: Can't stat %s: ", fn);
perror("");
return (NULL); return (NULL);
} }
} }
@@ -193,8 +196,10 @@ char *qualify(n)
* is it a bogus path? * is it a bogus path?
*/ */
if (stat(n, &statbuf)) { if (stat(n, &statbuf)) {
if (errno != ENOENT) if (errno != ENOENT) {
perror("qualify: stat"); fprintf(stderr, "sudo: Can't stat %s: ", n);
perror("");
}
return (NULL); return (NULL);
} }
@@ -249,7 +254,8 @@ char *qualify(n)
* check for symbolic links * check for symbolic links
*/ */
if (lstat(full, &statbuf)) { if (lstat(full, &statbuf)) {
perror("qualify: lstat"); fprintf(stderr, "sudo: Can't lstat %s: ", full);
perror("");
return (NULL); return (NULL);
} }