]> granicus.if.org Git - shadow/commitdiff
* src/usermod.c, src/useraddd.c: Fix the usage string so that it
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 11 Apr 2009 18:39:56 +0000 (18:39 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 11 Apr 2009 18:39:56 +0000 (18:39 +0000)
does not change depending on the configure option. Use a format.

ChangeLog
src/useradd.c
src/usermod.c

index 119a60eef7250105360672a0093475ec1c49fdf4..122c8e835f11ee99ee078fc3200a6f3a91a4fecf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-11  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/usermod.c, src/useraddd.c: Fix the usage string so that it
+       does not change depending on the configure option. Use a format.
+
 2009-04-11  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/gpasswd.c: Fix the usage of the unused macro.
index 89575dbd83337122262c0c4a74dd9a0ae9acda92..25d2908b387b551b52c09463deedc6d47db2e109 100644 (file)
@@ -144,7 +144,8 @@ static bool
     rflg = false,              /* create a system account */
     sflg = false,              /* shell program for new account */
     uflg = false,              /* specify user ID for new account */
-    Uflg = false;              /* create a group having the same name as the user */
+    Uflg = false,              /* create a group having the same name as the user */
+    Zflg = false;              /* new selinux user */
 
 static bool home_added = false;
 
@@ -664,7 +665,8 @@ static int get_groups (char *list)
  */
 static void usage (void)
 {
-       fputs (_("Usage: useradd [options] LOGIN\n"
+       fprintf (stderr,
+                _("Usage: useradd [options] LOGIN\n"
                 "\n"
                 "Options:\n"
                 "  -b, --base-dir BASE_DIR       base directory for the new user account\n"
@@ -698,10 +700,14 @@ static void usage (void)
                 "  -s, --shell SHELL             the login shell for the new user account\n"
                 "  -u, --uid UID                 force use the UID for the new user account\n"
                 "  -U, --user-group              create a group with the same name as the user\n"
+                "%s"
+                "\n"),
 #ifdef WITH_SELINUX
-                "  -Z, --selinux-user SEUSER     use a specific SEUSER for the SELinux user mapping\n"
+                _("  -Z, --selinux-user SEUSER     use a specific SEUSER for the SELinux user mapping\n")
+#else
+                ""
 #endif
-                "\n"), stderr);
+                );
        exit (E_USAGE);
 }
 
@@ -1173,6 +1179,7 @@ static void process_flags (int argc, char **argv)
                        case 'Z':
                                if (is_selinux_enabled () > 0) {
                                        user_selinux = optarg;
+                                       Zflg = true;
                                } else {
                                        fprintf (stderr,
                                                 _("%s: -Z requires SELinux enabled kernel\n"),
index 5b337fa3dcc1c362109e612dc013b538e02779fb..cec2d1ae91d9e22d693d478bc5335d80028c6f6e 100644 (file)
@@ -300,7 +300,8 @@ static int get_groups (char *list)
  */
 static void usage (void)
 {
-       fputs (_("Usage: usermod [options] LOGIN\n"
+       fprintf (stderr,
+                _("Usage: usermod [options] LOGIN\n"
                 "\n"
                 "Options:\n"
                 "  -c, --comment COMMENT         new value of the GECOS field\n"
@@ -323,10 +324,14 @@ static void usage (void)
                 "  -s, --shell SHELL             new login shell for the user account\n"
                 "  -u, --uid UID                 new UID for the user account\n"
                 "  -U, --unlock                  unlock the user account\n"
+                "%s"
+                "\n"),
 #ifdef WITH_SELINUX
-                "  -Z, --selinux-user            new SELinux user mapping for the user account\n"
+                _("  -Z, --selinux-user            new SELinux user mapping for the user account\n")
+#else
+                ""
 #endif
-                "\n"), stderr);
+                );
        exit (E_USAGE);
 }