]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
src/: Simplify error strings
authorAlejandro Colomar <alx@kernel.org>
Thu, 25 Jun 2026 20:28:59 +0000 (22:28 +0200)
committerSerge Hallyn <serge@hallyn.com>
Sun, 28 Jun 2026 17:01:24 +0000 (12:01 -0500)
Avoid language that would need translation.
Move language that would need translation to a separate argument.

Closes: <https://github.com/shadow-maint/shadow/issues/1662>
Reported-by: Rafael Fontenelle <https://github.com/rffontenelle>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/useradd.c
src/vipw.c

index d35c7e43fadf6038f90594e74730d91d2f98b1f0..1d712fd4c861dcfbb27b9cbd90de68971ad84331 100644 (file)
@@ -2304,13 +2304,13 @@ static void create_home(const struct option_flags *flags)
                }
                if (chown(path, 0, 0) < 0) {
                        fprintf(stderr,
-                               _("%s: warning: chown on `%s' failed: %m\n"),
-                               Prog, path);
+                               "%s: %s: chown(%s): %m\n",
+                               Prog, _("warning"), path);
                }
                if (chmod(path, 0755) < 0) {
                        fprintf(stderr,
-                               _("%s: warning: chmod on `%s' failed: %m\n"),
-                               Prog, path);
+                               "%s: %s: chmod(%s): %m\n",
+                               Prog, _("warning"), path);
                }
        }
        free(bhome);
@@ -2319,8 +2319,8 @@ static void create_home(const struct option_flags *flags)
        mode = getdef_num("HOME_MODE",
                          0777 & ~getdef_num("UMASK", GETDEF_DEFAULT_UMASK));
        if (chmod(prefix_user_home, mode)) {
-               fprintf(stderr, _("%s: warning: chown on '%s' failed: %m\n"),
-                       Prog, path);
+               fprintf(stderr, "%s: %s: chown(%s): %m\n",
+                       Prog, _("warning"), path);
        }
        home_added = true;
 #ifdef WITH_AUDIT
index 76edd42a52722b83c521942762f3531b73d15cc1..05c2935fcd63d4f6e0e55c59f22b39725a3a6a78 100644 (file)
@@ -314,15 +314,15 @@ vipwedit (const char *file, int (*file_lock) (void), int (*file_unlock) (bool))
 
                status = system (buf);
                if (-1 == status) {
-                       fprintf(stderr, _("%s: %s: %s\n"), Prog, editor, strerrno());
+                       fprintf(stderr, "%s: %s: %s\n", Prog, editor, strerrno());
                        exit (1);
                } else if (   WIFEXITED (status)
                           && (WEXITSTATUS (status) != 0)) {
-                       fprintf (stderr, _("%s: %s returned with status %d\n"),
+                       fprintf(stderr, "%s: %s: WEXITSTATUS(): %d\n",
                                 Prog, editor, WEXITSTATUS (status));
                        exit (WEXITSTATUS (status));
                } else if (WIFSIGNALED (status)) {
-                       fprintf (stderr, _("%s: %s killed by signal %d\n"),
+                       fprintf(stderr, "%s: %s: WTERMSIG(): %d\n",
                                 Prog, editor, WTERMSIG (status));
                        exit (1);
                } else {