[Pkg-shadow-commits] r3552 - in upstream/trunk: . man src
Nicolas FRANÇOIS
nekral-guest at alioth.debian.org
Sun Nov 6 18:39:09 UTC 2011
Author: nekral-guest
Date: 2011-11-06 18:39:09 +0000 (Sun, 06 Nov 2011)
New Revision: 3552
Modified:
upstream/trunk/ChangeLog
upstream/trunk/man/vipw.8.xml
upstream/trunk/src/vipw.c
Log:
* NEWS, src/vipw.c, man/vipw.8.xml: Add --root option.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2011-11-06 18:39:03 UTC (rev 3551)
+++ upstream/trunk/ChangeLog 2011-11-06 18:39:09 UTC (rev 3552)
@@ -1,5 +1,9 @@
2011-10-30 Nicolas François <nicolas.francois at centraliens.net>
+ * NEWS, src/vipw.c, man/vipw.8.xml: Add --root option.
+
+2011-10-30 Nicolas François <nicolas.francois at centraliens.net>
+
* NEWS, src/faillog.c, man/faillog.8.xml: Add --root option.
* NEWS, src/lastlog.c, man/lastlog.8.xml: Likewise.
* src/faillog.c: Add Prog variable, and prefix error messages with
Modified: upstream/trunk/man/vipw.8.xml
===================================================================
--- upstream/trunk/man/vipw.8.xml 2011-11-06 18:39:03 UTC (rev 3551)
+++ upstream/trunk/man/vipw.8.xml 2011-11-06 18:39:09 UTC (rev 3552)
@@ -2,7 +2,7 @@
<!--
Copyright (c) 1997 , Marek Michałkiewicz
Copyright (c) 2001 - 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
@@ -116,6 +116,19 @@
</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>--shadow</option></term>
<listitem>
<para>Edit shadow or gshadow database.</para>
Modified: upstream/trunk/src/vipw.c
===================================================================
--- upstream/trunk/src/vipw.c 2011-11-06 18:39:03 UTC (rev 3551)
+++ upstream/trunk/src/vipw.c 2011-11-06 18:39:09 UTC (rev 3552)
@@ -5,7 +5,7 @@
Copyright (c) 1997 , Guy Maor <maor at ece.utexas.edu>
Copyright (c) 1999 - 2000, Marek Michałkiewicz
Copyright (c) 2002 - 2006, Tomasz Kłoczko
- Copyright (c) 2007 - 2010, Nicolas François
+ Copyright (c) 2007 - 2011, Nicolas François
All rights reserved.
This program is free software; you can redistribute it and/or modify
@@ -93,6 +93,7 @@
(void) fputs (_(" -h, --help display this help message and exit\n"), usageout);
(void) fputs (_(" -p, --passwd edit passwd database\n"), usageout);
(void) fputs (_(" -q, --quiet quiet mode\n"), usageout);
+ (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout);
(void) fputs (_(" -s, --shadow edit shadow or gshadow database\n"), usageout);
#ifdef WITH_TCB
(void) fputs (_(" -u, --user which user's tcb shadow file to edit\n"), usageout);
@@ -415,11 +416,14 @@
char *a;
bool do_vipw;
+ Prog = Basename (argv[0]);
+
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);
- Prog = ((a = strrchr (*argv, '/')) ? a + 1 : *argv);
+ process_root_flag ("-R", argc, argv);
+
do_vipw = (strcmp (Prog, "vigr") != 0);
OPENLOG (do_vipw ? "vipw" : "vigr");
@@ -434,6 +438,7 @@
{"help", no_argument, NULL, 'h'},
{"passwd", no_argument, NULL, 'p'},
{"quiet", no_argument, NULL, 'q'},
+ {"root", required_argument, NULL, 'R'},
{"shadow", no_argument, NULL, 's'},
#ifdef WITH_TCB
{"user", required_argument, NULL, 'u'},
@@ -442,9 +447,9 @@
};
while ((c = getopt_long (argc, argv,
#ifdef WITH_TCB
- "ghpqsu:",
+ "ghpqR:su:",
#else /* !WITH_TCB */
- "ghpqs",
+ "ghpqR:s",
#endif /* !WITH_TCB */
long_options, NULL)) != -1) {
switch (c) {
@@ -460,6 +465,8 @@
case 'q':
quiet = true;
break;
+ case 'R': /* no-op, handled in process_root_flag () */
+ break;
case 's':
editshadow = true;
break;
More information about the Pkg-shadow-commits
mailing list