* NEWS, src/newusers.c, man/newusers.8.xml: Add --root option.

This commit is contained in:
nekral-guest 2011-11-06 18:40:22 +00:00
parent 2a2c8190ec
commit f3afeb9c04
4 changed files with 27 additions and 1 deletions

View File

@ -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.

2
NEWS
View File

@ -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

View 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
@ -281,6 +281,19 @@
</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">

View 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);