]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
* NEWS, src/newusers.c, man/newusers.8.xml: Add --root option.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 6 Nov 2011 18:40:22 +0000 (18:40 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 6 Nov 2011 18:40:22 +0000 (18:40 +0000)
ChangeLog
NEWS
man/newusers.8.xml
src/newusers.c

index 6fd445ebb5b264ca690daeee1b88d9e6c7b60579..5545263134310abd2c5c4ae7b212099a22eda7eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-06  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * NEWS, src/newusers.c, man/newusers.8.xml: Add --root option.
+
 2011-11-06  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/vipw.c: Remove unused variable a.
diff --git a/NEWS b/NEWS
index 267196faf38b0ce35ad00c49cea7b9481261e582..7df574e816921ea43527547d704dd9ed9a3f1b20 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -76,6 +76,8 @@ shadow-4.1.4.3 -> shadow-4.1.5                                        UNRELEASED
     pam_lastlog.
 - newgrp, sg
   * Fix parsing of gshadow entries.
+- newusers
+  * Add --root option.
 - passwd
   * Add --root option.
 - pwpck
index 5384353e6c65045621b1372cf6f1a147c30d1247..ba61594134e06e8ca2c91d2ab4b3602bbf79524e 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
    Copyright (c) 1991 - 1994, Julianne Frances Haugh
-   Copyright (c) 2007 - 2009, Nicolas François
+   Copyright (c) 2007 - 2011, Nicolas François
    All rights reserved.
   
    Redistribution and use in source and binary forms, with or without
          </para>
        </listitem>
       </varlistentry>
+      <varlistentry>
+       <term>
+         <option>-R</option>, <option>--root</option>
+         <replaceable>CHROOT_DIR</replaceable>
+       </term>
+       <listitem>
+         <para>
+           Apply changes in the <replaceable>CHROOT_DIR</replaceable>
+           directory and use the configuration files from the
+           <replaceable>CHROOT_DIR</replaceable> directory.
+         </para>
+       </listitem>
+      </varlistentry>
     </variablelist>
     <variablelist remap='IP' condition="no_pam">
       <varlistentry condition="sha_crypt">
index 1f9e357015d8e26c3cfaf9d88906f4c2872b423d..2e46ecbf55e6fd9275f4a93a0048df9d753d3d3f 100644 (file)
@@ -130,6 +130,7 @@ static void usage (int status)
 #endif                         /* !USE_PAM */
        (void) fputs (_("  -h, --help                    display this help message and exit\n"), usageout);
        (void) fputs (_("  -r, --system                  create system accounts\n"), usageout);
+       (void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), usageout);
 #ifndef USE_PAM
 #ifdef USE_SHA_CRYPT
        (void) fputs (_("  -s, --sha-rounds              number of SHA rounds for the SHA*\n"
@@ -530,6 +531,7 @@ static void process_flags (int argc, char **argv)
 #endif                         /* !USE_PAM */
                {"help",         no_argument,       NULL, 'h'},
                {"system",       no_argument,       NULL, 'r'},
+               {"root",         required_argument, NULL, 'R'},
 #ifndef USE_PAM
 #ifdef USE_SHA_CRYPT
                {"sha-rounds",   required_argument, NULL, 's'},
@@ -561,6 +563,8 @@ static void process_flags (int argc, char **argv)
                case 'r':
                        rflg = true;
                        break;
+               case 'R': /* no-op, handled in process_root_flag () */
+                       break;
 #ifndef USE_PAM
 #ifdef USE_SHA_CRYPT
                case 's':
@@ -838,6 +842,9 @@ int main (int argc, char **argv)
        (void) bindtextdomain (PACKAGE, LOCALEDIR);
        (void) textdomain (PACKAGE);
 
+       /* FIXME: will not work with an input file */
+       process_root_flag ("-R", argc, argv);
+
        OPENLOG ("newusers");
 
        process_flags (argc, argv);