#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
+#include <errno.h>
#include "sudoers.h"
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
*/
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;
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;