[Pkg-shadow-commits] r3542 - in upstream/trunk: . man src
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Sun Nov 6 18:38:11 UTC 2011
Author: nekral-guest
Date: 2011-11-06 18:38:10 +0000 (Sun, 06 Nov 2011)
New Revision: 3542
Modified:
upstream/trunk/ChangeLog
upstream/trunk/NEWS
upstream/trunk/man/chgpasswd.8.xml
upstream/trunk/man/chpasswd.8.xml
upstream/trunk/src/chgpasswd.c
upstream/trunk/src/chpasswd.c
Log:
* NEWS, src/chpasswd.c, man/chpasswd.8.xml, src/chgpasswd.c,
man/chgpasswd.8.xml: Add --root option.
* src/chpasswd.c, src/chgpasswd.c: The getopt index of long
options is not used.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2011-11-06 18:38:04 UTC (rev 3541)
+++ upstream/trunk/ChangeLog 2011-11-06 18:38:10 UTC (rev 3542)
@@ -17,7 +17,7 @@
of main().
* NEWS, src/groupadd.c, man/groupadd.8.xml: Add --root option. Open
audit and syslog after the potential chroot.
- * src/groupmod.c: The index of long options is not used.
+ * src/groupmod.c: The getopt index of long options is not used.
* src/groupdel.c: Add process_flags().
* src/groupdel.c, man/groupdel.8.xml: Add --help option.
* NEWS, src/groupdel.c, man/groupdel.8.xml: Add --root option. Open
@@ -29,6 +29,10 @@
Add --help option.
* src/pwconv.c, src/pwunconv.c, src/grpconv.c, src/grpunconv.c:
Add process_flags() and usage().
+ * NEWS, src/chpasswd.c, man/chpasswd.8.xml, src/chgpasswd.c,
+ man/chgpasswd.8.xml: Add --root option.
+ * src/chpasswd.c, src/chgpasswd.c: The getopt index of long
+ options is not used.
2011-10-22 Nicolas François <nicolas.francois at centraliens.net>
Modified: upstream/trunk/NEWS
===================================================================
--- upstream/trunk/NEWS 2011-11-06 18:38:04 UTC (rev 3541)
+++ upstream/trunk/NEWS 2011-11-06 18:38:10 UTC (rev 3542)
@@ -20,6 +20,7 @@
* When the gshadow file exists but there are no gshadow entries, an entry
is created if the password is changed and group requires a
shadow entry.
+ * Add --root option.
-chpasswd
* PAM enabled versions: restore the -e option to allow restoring
passwords without knowing those passwords. Restore together the -m
@@ -28,6 +29,7 @@
* When the shadow file exists but there are no shadow entries, an entry
is created if the password is changed and passwd requires a
shadow entry.
+ * Add --root option.
- faillog
* The -l, -m, -r, -t options only act on the existing users, unless -a is
specified.
Modified: upstream/trunk/man/chgpasswd.8.xml
===================================================================
--- upstream/trunk/man/chgpasswd.8.xml 2011-11-06 18:38:04 UTC (rev 3541)
+++ upstream/trunk/man/chgpasswd.8.xml 2011-11-06 18:38:10 UTC (rev 3542)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2006 , Tomasz Kłoczko
- 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
@@ -128,6 +128,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>
<varlistentry condition="sha_crypt">
<term><option>-s</option>, <option>--sha-rounds</option></term>
<listitem>
Modified: upstream/trunk/man/chpasswd.8.xml
===================================================================
--- upstream/trunk/man/chpasswd.8.xml 2011-11-06 18:38:04 UTC (rev 3541)
+++ upstream/trunk/man/chpasswd.8.xml 2011-11-06 18:38:10 UTC (rev 3542)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 1991 , 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
@@ -166,6 +166,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>
<varlistentry condition="sha_crypt">
<term>
<option>-s</option>, <option>--sha-rounds</option>
Modified: upstream/trunk/src/chgpasswd.c
===================================================================
--- upstream/trunk/src/chgpasswd.c 2011-11-06 18:38:04 UTC (rev 3541)
+++ upstream/trunk/src/chgpasswd.c 2011-11-06 18:38:10 UTC (rev 3542)
@@ -135,6 +135,7 @@
(void) fputs (_(" -m, --md5 encrypt the clear text password using\n"
" the MD5 algorithm\n"),
usageout);
+ (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
#ifdef USE_SHA_CRYPT
(void) fputs (_(" -s, --sha-rounds number of SHA rounds for the SHA*\n"
" crypt algorithms\n"),
@@ -152,13 +153,13 @@
*/
static void process_flags (int argc, char **argv)
{
- int option_index = 0;
int c;
static struct option long_options[] = {
{"crypt-method", required_argument, NULL, 'c'},
{"encrypted", no_argument, NULL, 'e'},
{"help", no_argument, NULL, 'h'},
{"md5", no_argument, NULL, 'm'},
+ {"root", required_argument, NULL, 'R'},
#ifdef USE_SHA_CRYPT
{"sha-rounds", required_argument, NULL, 's'},
#endif
@@ -167,11 +168,11 @@
while ((c = getopt_long (argc, argv,
#ifdef USE_SHA_CRYPT
- "c:ehms:",
+ "c:ehmR:s:",
#else
- "c:ehm",
+ "c:ehmR:",
#endif
- long_options, &option_index)) != -1) {
+ long_options, NULL)) != -1) {
switch (c) {
case 'c':
crypt_method = optarg;
@@ -185,6 +186,8 @@
case 'm':
md5flg = true;
break;
+ case 'R': /* no-op, handled in process_root_flag () */
+ break;
#ifdef USE_SHA_CRYPT
case 's':
sflg = true;
@@ -396,6 +399,8 @@
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);
+ process_root_flag ("-R", argc, argv);
+
process_flags (argc, argv);
OPENLOG ("chgpasswd");
Modified: upstream/trunk/src/chpasswd.c
===================================================================
--- upstream/trunk/src/chpasswd.c 2011-11-06 18:38:04 UTC (rev 3541)
+++ upstream/trunk/src/chpasswd.c 2011-11-06 18:38:10 UTC (rev 3542)
@@ -128,6 +128,7 @@
(void) fputs (_(" -m, --md5 encrypt the clear text password using\n"
" the MD5 algorithm\n"),
usageout);
+ (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
#ifdef USE_SHA_CRYPT
(void) fputs (_(" -s, --sha-rounds number of SHA rounds for the SHA*\n"
" crypt algorithms\n"),
@@ -145,12 +146,12 @@
*/
static void process_flags (int argc, char **argv)
{
- int option_index = 0;
int c;
static struct option long_options[] = {
{"crypt-method", required_argument, NULL, 'c'},
{"encrypted", no_argument, NULL, 'e'},
{"md5", no_argument, NULL, 'm'},
+ {"root", required_argument, NULL, 'R'},
#ifdef USE_SHA_CRYPT
{"sha-rounds", required_argument, NULL, 's'},
#endif /* USE_SHA_CRYPT */
@@ -160,11 +161,11 @@
while ((c = getopt_long (argc, argv,
#ifdef USE_SHA_CRYPT
- "c:ehms:",
+ "c:ehmR:s:",
#else /* !USE_SHA_CRYPT */
- "c:ehm",
+ "c:ehmR:",
#endif /* !USE_SHA_CRYPT */
- long_options, &option_index)) != -1) {
+ long_options, NULL)) != -1) {
switch (c) {
case 'h':
usage (E_SUCCESS);
@@ -178,6 +179,8 @@
case 'm':
md5flg = true;
break;
+ case 'R': /* no-op, handled in process_root_flag () */
+ break;
#ifdef USE_SHA_CRYPT
case 's':
sflg = true;
@@ -387,6 +390,8 @@
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);
+ process_root_flag ("-R", argc, argv);
+
process_flags (argc, argv);
#ifdef USE_PAM
More information about the Pkg-shadow-commits
mailing list