* 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

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