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

ChangeLog
NEWS
man/grpck.8.xml
man/pwck.8.xml
src/grpck.c
src/pwck.c

index a50308a28cd6503a9dab495a159023def7354b70..ab59d79c02ed3dd6ef9ec6c64cc395078df248dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-31  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * NEWS, src/pwck.c, man/pwck.8.xm, src/grpck.c, man/grpck.8.xml:
+       Add --root option.
+
 2011-10-31  Nicolas François  <nicolas.francois@centraliens.net>
 
        * man/limits.5.xml, libmisc/limits.c: Sort limit identifiers.
diff --git a/NEWS b/NEWS
index fd0f1c9c0ae7f98e701e6111c0b194316f0651b4..267196faf38b0ce35ad00c49cea7b9481261e582 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -56,6 +56,7 @@ shadow-4.1.4.3 -> shadow-4.1.5                                        UNRELEASED
     shadow entry.
   * Add --root option.
 - grpck
+  * Add --root option.
   * NIS entries were dropped by -s (sort).
 - grpconv
   * Add --root option.
@@ -79,6 +80,7 @@ shadow-4.1.4.3 -> shadow-4.1.5                                        UNRELEASED
   * Add --root option.
 - pwpck
   * NIS entries were dropped by -s (sort).
+  * Add --root option.
 - pwconv
   * Add --root option.
 - pwunconv
index eb6355a3313685b41c83ea05ca930022584f285b..162d077151d61721cafc4965d243e8541f95364f 100644 (file)
          </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>
       <varlistentry>
        <term><option>-s</option>, <option>--sort</option></term>
        <listitem>
index bf617674a7cb3ec11c805bcccb7bcae13d5668a5..1fa6808a9c1d642ceb2dd180901d5e93366272a4 100644 (file)
          </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>
       <varlistentry>
        <term><option>-s</option>, <option>--sort</option></term>
        <listitem>
index ee306b47b7ac39c08642ea30afa5d7f7f9a5a45e..9d1ed9032dd1f2bfd492a7774cc9abfbfeb130ef 100644 (file)
@@ -155,6 +155,7 @@ static /*@noreturn@*/void usage (int status)
        (void) fputs (_("  -h, --help                    display this help message and exit\n"), usageout);
        (void) fputs (_("  -r, --read-only               display errors and warnings\n"
                        "                                but do not change files\n"), usageout);
+       (void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), usageout);
        (void) fputs (_("  -s, --sort                    sort entries by UID\n"), usageout);
        (void) fputs ("\n", usageout);
        exit (status);
@@ -191,17 +192,18 @@ static void process_flags (int argc, char **argv)
 {
        int c;
        static struct option long_options[] = {
-               {"help",      no_argument, NULL, 'h'},
-               {"quiet",     no_argument, NULL, 'q'},
-               {"read-only", no_argument, NULL, 'r'},
-               {"sort",      no_argument, NULL, 's'},
+               {"help",      no_argument,       NULL, 'h'},
+               {"quiet",     no_argument,       NULL, 'q'},
+               {"read-only", no_argument,       NULL, 'r'},
+               {"root",      required_argument, NULL, 'R'},
+               {"sort",      no_argument,       NULL, 's'},
                {NULL, 0, NULL, '\0'}
        };
 
        /*
         * Parse the command line arguments
         */
-       while ((c = getopt_long (argc, argv, "hqrs",
+       while ((c = getopt_long (argc, argv, "hqrR:s",
                                 long_options, NULL)) != -1) {
                switch (c) {
                case 'h':
@@ -213,6 +215,8 @@ static void process_flags (int argc, char **argv)
                case 'r':
                        read_only = true;
                        break;
+               case 'R': /* no-op, handled in process_root_flag () */
+                       break;
                case 's':
                        sort_mode = true;
                        break;
@@ -836,6 +840,8 @@ int main (int argc, char **argv)
        (void) bindtextdomain (PACKAGE, LOCALEDIR);
        (void) textdomain (PACKAGE);
 
+       process_root_flag ("-R", argc, argv);
+
        OPENLOG ("grpck");
 
        /* Parse the command line arguments */
index c70edc0a648101a051199c87ca27f529652e46e4..2caf2ee33fa4fee6603a55e398eaf13345e17e61 100644 (file)
@@ -152,6 +152,7 @@ static /*@noreturn@*/void usage (int status)
        (void) fputs (_("  -q, --quiet                   report errors only\n"), usageout);
        (void) fputs (_("  -r, --read-only               display errors and warnings\n"
                        "                                but do not change files\n"), usageout);
+       (void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), usageout);
 #ifdef WITH_TCB
        if (!getdef_bool ("USE_TCB")) {
 #endif                         /* !WITH_TCB */
@@ -171,17 +172,18 @@ static void process_flags (int argc, char **argv)
 {
        int c;
        static struct option long_options[] = {
-               {"help",      no_argument, NULL, 'h'},
-               {"quiet",     no_argument, NULL, 'q'},
-               {"read-only", no_argument, NULL, 'r'},
-               {"sort",      no_argument, NULL, 's'},
+               {"help",      no_argument,       NULL, 'h'},
+               {"quiet",     no_argument,       NULL, 'q'},
+               {"read-only", no_argument,       NULL, 'r'},
+               {"root",      required_argument, NULL, 'R'},
+               {"sort",      no_argument,       NULL, 's'},
                {NULL, 0, NULL, '\0'}
        };
 
        /*
         * Parse the command line arguments
         */
-       while ((c = getopt_long (argc, argv, "ehqrs",
+       while ((c = getopt_long (argc, argv, "ehqrR:s",
                                 long_options, NULL)) != -1) {
                switch (c) {
                case 'h':
@@ -194,6 +196,8 @@ static void process_flags (int argc, char **argv)
                case 'r':
                        read_only = true;
                        break;
+               case 'R': /* no-op, handled in process_root_flag () */
+                       break;
                case 's':
                        sort_mode = true;
                        break;
@@ -835,6 +839,8 @@ int main (int argc, char **argv)
        (void) bindtextdomain (PACKAGE, LOCALEDIR);
        (void) textdomain (PACKAGE);
 
+       process_root_flag ("-R", argc, argv);
+
        OPENLOG ("pwck");
 
        /* Parse the command line arguments */