flags = 0;
else
flags = NO_MAIL;
- log_error(flags, _("%d incorrect password attempt%s"),
- def_passwd_tries - counter,
- (def_passwd_tries - counter == 1) ? "" : "s");
+ log_error(flags, ngettext("%d incorrect password attempt",
+ "%d incorrect password attempts",
+ def_passwd_tries - counter), def_passwd_tries - counter);
}
audit_failure(NewArgv, "authentication failure");
rval = FALSE;
#ifdef ENV_DEBUG
if (env.envp[env.env_len] != NULL)
- errorx(1, _("sudo_putenv: corrupted envp, len mismatch"));
+ errorx(1, _("sudo_putenv: corrupted envp, length mismatch"));
#endif
if (dupcheck) {
#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;
goto done;
}
if ((sb.st_mode & (S_IWGRP|S_IWOTH)) != 0) {
- warningx(_("%s must be only be writable by owner"), path);
+ warningx(_("%s must only be writable by owner"), path);
goto done;
}
}
}
if (strlen(user_cmnd) >= PATH_MAX)
- errorx(1, _("%s: file name too long"), user_cmnd);
+ errorx(1, _("%s: %s"), user_cmnd, strerror(ENAMETOOLONG));
if ((user_base = strrchr(user_cmnd, '/')) != NULL)
user_base++;
if (login_class && strcmp(login_class, "-") != 0) {
if (user_uid != 0 &&
strcmp(runas_user ? runas_user : def_runas_default, "root") != 0)
- errorx(1, _("only root can use -c %s"), login_class);
+ errorx(1, _("only root can use `-c %s'"), login_class);
} else {
login_class = pw->pw_class;
if (!login_class || !*login_class)
#ifdef HAVE_REGCOMP
if (type == ST_PATTERN) {
if (regcomp(&newsn->u.cmdre, *av, REG_EXTENDED|REG_NOSUB) != 0)
- errorx(1, _("invalid regex: %s"), *av);
+ errorx(1, _("invalid regular expression: %s"), *av);
} else
#endif
if (type == ST_TODATE || type == ST_FROMDATE) {
/* Mock up a fake sudo_user struct. */
user_cmnd = "";
if ((sudo_user.pw = sudo_getpwuid(getuid())) == NULL)
- errorx(1, _("you don't exist in the passwd database"));
+ errorx(1, _("you do not exist in the %s database"), "passwd");
get_hostname();
/* Setup defaults data structures. */
switch (pid = fork()) {
case -1:
- error(1, _("unable to run %s"), path);
+ error(1, _("unable to execute %s"), path);
break; /* NOTREACHED */
case 0:
sudo_endpwent();