* NEWS, src/pwck.c, man/pwck.8.xm, src/grpck.c, man/grpck.8.xml:

Add --root option.
This commit is contained in:
nekral-guest 2011-11-06 18:39:53 +00:00
parent e4fbf98b18
commit 7d8ca29bea
6 changed files with 55 additions and 10 deletions

View File

@ -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> 2011-10-31 Nicolas François <nicolas.francois@centraliens.net>
* man/limits.5.xml, libmisc/limits.c: Sort limit identifiers. * man/limits.5.xml, libmisc/limits.c: Sort limit identifiers.

2
NEWS
View File

@ -56,6 +56,7 @@ shadow-4.1.4.3 -> shadow-4.1.5 UNRELEASED
shadow entry. shadow entry.
* Add --root option. * Add --root option.
- grpck - grpck
* Add --root option.
* NIS entries were dropped by -s (sort). * NIS entries were dropped by -s (sort).
- grpconv - grpconv
* Add --root option. * Add --root option.
@ -79,6 +80,7 @@ shadow-4.1.4.3 -> shadow-4.1.5 UNRELEASED
* Add --root option. * Add --root option.
- pwpck - pwpck
* NIS entries were dropped by -s (sort). * NIS entries were dropped by -s (sort).
* Add --root option.
- pwconv - pwconv
* Add --root option. * Add --root option.
- pwunconv - pwunconv

View File

@ -150,6 +150,19 @@
</para> </para>
</listitem> </listitem>
</varlistentry> </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> <varlistentry>
<term><option>-s</option>, <option>--sort</option></term> <term><option>-s</option>, <option>--sort</option></term>
<listitem> <listitem>

View File

@ -186,6 +186,19 @@
</para> </para>
</listitem> </listitem>
</varlistentry> </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> <varlistentry>
<term><option>-s</option>, <option>--sort</option></term> <term><option>-s</option>, <option>--sort</option></term>
<listitem> <listitem>

View 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 (_(" -h, --help display this help message and exit\n"), usageout);
(void) fputs (_(" -r, --read-only display errors and warnings\n" (void) fputs (_(" -r, --read-only display errors and warnings\n"
" but do not change files\n"), usageout); " 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 (_(" -s, --sort sort entries by UID\n"), usageout);
(void) fputs ("\n", usageout); (void) fputs ("\n", usageout);
exit (status); exit (status);
@ -194,6 +195,7 @@ static void process_flags (int argc, char **argv)
{"help", no_argument, NULL, 'h'}, {"help", no_argument, NULL, 'h'},
{"quiet", no_argument, NULL, 'q'}, {"quiet", no_argument, NULL, 'q'},
{"read-only", no_argument, NULL, 'r'}, {"read-only", no_argument, NULL, 'r'},
{"root", required_argument, NULL, 'R'},
{"sort", no_argument, NULL, 's'}, {"sort", no_argument, NULL, 's'},
{NULL, 0, NULL, '\0'} {NULL, 0, NULL, '\0'}
}; };
@ -201,7 +203,7 @@ static void process_flags (int argc, char **argv)
/* /*
* Parse the command line arguments * Parse the command line arguments
*/ */
while ((c = getopt_long (argc, argv, "hqrs", while ((c = getopt_long (argc, argv, "hqrR:s",
long_options, NULL)) != -1) { long_options, NULL)) != -1) {
switch (c) { switch (c) {
case 'h': case 'h':
@ -213,6 +215,8 @@ static void process_flags (int argc, char **argv)
case 'r': case 'r':
read_only = true; read_only = true;
break; break;
case 'R': /* no-op, handled in process_root_flag () */
break;
case 's': case 's':
sort_mode = true; sort_mode = true;
break; break;
@ -836,6 +840,8 @@ int main (int argc, char **argv)
(void) bindtextdomain (PACKAGE, LOCALEDIR); (void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE); (void) textdomain (PACKAGE);
process_root_flag ("-R", argc, argv);
OPENLOG ("grpck"); OPENLOG ("grpck");
/* Parse the command line arguments */ /* Parse the command line arguments */

View File

@ -152,6 +152,7 @@ static /*@noreturn@*/void usage (int status)
(void) fputs (_(" -q, --quiet report errors only\n"), usageout); (void) fputs (_(" -q, --quiet report errors only\n"), usageout);
(void) fputs (_(" -r, --read-only display errors and warnings\n" (void) fputs (_(" -r, --read-only display errors and warnings\n"
" but do not change files\n"), usageout); " but do not change files\n"), usageout);
(void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
#ifdef WITH_TCB #ifdef WITH_TCB
if (!getdef_bool ("USE_TCB")) { if (!getdef_bool ("USE_TCB")) {
#endif /* !WITH_TCB */ #endif /* !WITH_TCB */
@ -174,6 +175,7 @@ static void process_flags (int argc, char **argv)
{"help", no_argument, NULL, 'h'}, {"help", no_argument, NULL, 'h'},
{"quiet", no_argument, NULL, 'q'}, {"quiet", no_argument, NULL, 'q'},
{"read-only", no_argument, NULL, 'r'}, {"read-only", no_argument, NULL, 'r'},
{"root", required_argument, NULL, 'R'},
{"sort", no_argument, NULL, 's'}, {"sort", no_argument, NULL, 's'},
{NULL, 0, NULL, '\0'} {NULL, 0, NULL, '\0'}
}; };
@ -181,7 +183,7 @@ static void process_flags (int argc, char **argv)
/* /*
* Parse the command line arguments * Parse the command line arguments
*/ */
while ((c = getopt_long (argc, argv, "ehqrs", while ((c = getopt_long (argc, argv, "ehqrR:s",
long_options, NULL)) != -1) { long_options, NULL)) != -1) {
switch (c) { switch (c) {
case 'h': case 'h':
@ -194,6 +196,8 @@ static void process_flags (int argc, char **argv)
case 'r': case 'r':
read_only = true; read_only = true;
break; break;
case 'R': /* no-op, handled in process_root_flag () */
break;
case 's': case 's':
sort_mode = true; sort_mode = true;
break; break;
@ -835,6 +839,8 @@ int main (int argc, char **argv)
(void) bindtextdomain (PACKAGE, LOCALEDIR); (void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE); (void) textdomain (PACKAGE);
process_root_flag ("-R", argc, argv);
OPENLOG ("pwck"); OPENLOG ("pwck");
/* Parse the command line arguments */ /* Parse the command line arguments */