]> granicus.if.org Git - sudo/commitdiff
Minor warning/error cleanup
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 18 May 2011 17:44:36 +0000 (13:44 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 18 May 2011 17:44:36 +0000 (13:44 -0400)
plugins/sudoers/auth/sudo_auth.c
plugins/sudoers/env.c
plugins/sudoers/find_path.c
plugins/sudoers/group_plugin.c
plugins/sudoers/sudoers.c
plugins/sudoers/sudoreplay.c
plugins/sudoers/visudo.c

index 58ba3ec2b96b5be35a1336643539e1b2a1a638a1..f82b5cb7fd76726f2bb7d49d846610b99a99caa4 100644 (file)
@@ -240,9 +240,9 @@ cleanup:
                    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;
index f4fd9d1dbcf8fd6400b67b8dc45e0c2bc4de6527..3e713fd65a379854e538c98cf2e44fc9e0e3377a 100644 (file)
@@ -286,7 +286,7 @@ sudo_putenv(char *str, int dupcheck, int overwrite)
 
 #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) {
index 63ec3fe9c92f3354ef5f3938f732aac8aa4677d4..4064248e3d181e06ae927e2c1b731e3737e49828 100644 (file)
@@ -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;
index 8f40af6b7f850c3627514b42a00d1a234fd7f828..2bc536cbc9706d156f3849c6a21ff64dd6d2d8ff 100644 (file)
@@ -104,7 +104,7 @@ group_plugin_load(char *plugin_info)
        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;
     }
 
index efd4078a2cc0f473bf7bcfadeede9a8b7ae6b396..f639d1e25648887d5d9616cec803e276ccc5b196 100644 (file)
@@ -867,7 +867,7 @@ set_cmnd(int sudo_mode)
        }
     }
     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++;
@@ -979,7 +979,7 @@ set_loginclass(struct passwd *pw)
     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)
index 6cada297b75036d953de8cdd5e70b66a40a6cf25..828cf341edad67338f6a25c8f1923dd6639d5d96 100644 (file)
@@ -578,7 +578,7 @@ parse_expr(struct search_node **headp, char *argv[])
 #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) {
index 6963c8a974a6ee819dd9c21b1700d72c8c83bf51..49e87f7b2279f6fda4b0655636b34aec97752036 100644 (file)
@@ -210,7 +210,7 @@ main(int argc, char *argv[])
     /* 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. */
@@ -670,7 +670,7 @@ run_command(char *path, char **argv)
 
     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();