Minor warning/error cleanup
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#include <errno.h>
|
||||
|
||||
#include "sudoers.h"
|
||||
|
||||
@@ -64,7 +65,7 @@ find_path(char *infile, char **outfile, struct stat *sbp, char *path,
|
||||
int len; /* length parameter */
|
||||
|
||||
if (strlen(infile) >= PATH_MAX)
|
||||
errorx(1, _("%s: File name too long"), infile);
|
||||
errorx(1, _("%s: %s"), infile, strerror(ENAMETOOLONG));
|
||||
|
||||
/*
|
||||
* If we were given a fully qualified or relative path
|
||||
@@ -103,7 +104,7 @@ find_path(char *infile, char **outfile, struct stat *sbp, char *path,
|
||||
*/
|
||||
len = snprintf(command, sizeof(command), "%s/%s", path, infile);
|
||||
if (len <= 0 || len >= sizeof(command))
|
||||
errorx(1, _("%s: File name too long"), infile);
|
||||
errorx(1, _("%s: %s"), infile, strerror(ENAMETOOLONG));
|
||||
if ((result = sudo_goodpath(command, sbp)))
|
||||
break;
|
||||
|
||||
@@ -118,7 +119,7 @@ find_path(char *infile, char **outfile, struct stat *sbp, char *path,
|
||||
if (!result && checkdot) {
|
||||
len = snprintf(command, sizeof(command), "./%s", infile);
|
||||
if (len <= 0 || len >= sizeof(command))
|
||||
errorx(1, _("%s: File name too long"), infile);
|
||||
errorx(1, _("%s: %s"), infile, strerror(ENAMETOOLONG));
|
||||
result = sudo_goodpath(command, sbp);
|
||||
if (result && ignore_dot)
|
||||
return NOT_FOUND_DOT;
|
||||
|
Reference in New Issue
Block a user