* NEWS, src/gpasswd.c, man/gpasswd.1.xml: Add --root option.
* src/gpasswd.c: The getopt index of long options is not used.
This commit is contained in:
parent
4beca611fb
commit
7b8c4952a8
@ -42,6 +42,8 @@
|
|||||||
* NEWS, src/chsh.c, man/chsh.1.xml: Add --root option.
|
* NEWS, src/chsh.c, man/chsh.1.xml: Add --root option.
|
||||||
chsh's usage split in smaller messages.
|
chsh's usage split in smaller messages.
|
||||||
* src/chsh.c: The getopt index of long options is not used.
|
* src/chsh.c: The getopt index of long options is not used.
|
||||||
|
* NEWS, src/gpasswd.c, man/gpasswd.1.xml: Add --root option.
|
||||||
|
* src/gpasswd.c: The getopt index of long options is not used.
|
||||||
|
|
||||||
2011-10-22 Nicolas François <nicolas.francois@centraliens.net>
|
2011-10-22 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
2
NEWS
2
NEWS
@ -35,6 +35,8 @@ shadow-4.1.4.3 -> shadow-4.1.5 UNRELEASED
|
|||||||
- faillog
|
- faillog
|
||||||
* The -l, -m, -r, -t options only act on the existing users, unless -a is
|
* The -l, -m, -r, -t options only act on the existing users, unless -a is
|
||||||
specified.
|
specified.
|
||||||
|
- gpasswd
|
||||||
|
* Add --root option.
|
||||||
- groupadd
|
- groupadd
|
||||||
* Add --root option.
|
* Add --root option.
|
||||||
- groupdel
|
- groupdel
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright (c) 1996 , Rafal Maszkowski
|
Copyright (c) 1996 , Rafal Maszkowski
|
||||||
Copyright (c) 2007 - 2009, Nicolas François
|
Copyright (c) 2007 - 2011, Nicolas François
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
@ -157,6 +157,21 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
<variablelist remap='IP'>
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<option>-Q</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'>
|
<variablelist remap='IP'>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
|
@ -136,6 +136,7 @@ static void usage (int status)
|
|||||||
(void) fputs (_(" -a, --add USER add USER to GROUP\n"), usageout);
|
(void) fputs (_(" -a, --add USER add USER to GROUP\n"), usageout);
|
||||||
(void) fputs (_(" -d, --delete USER remove USER from GROUP\n"), usageout);
|
(void) fputs (_(" -d, --delete USER remove USER from GROUP\n"), usageout);
|
||||||
(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 (_(" -Q, --root CHROOT_DIR directory to chroot into\n"), usageout);
|
||||||
(void) fputs (_(" -r, --remove-password remove the GROUP's password\n"), usageout);
|
(void) fputs (_(" -r, --remove-password remove the GROUP's password\n"), usageout);
|
||||||
(void) fputs (_(" -R, --restrict restrict access to GROUP to its members\n"), usageout);
|
(void) fputs (_(" -R, --restrict restrict access to GROUP to its members\n"), usageout);
|
||||||
(void) fputs (_(" -M, --members USER,... set the list of members of GROUP\n"), usageout);
|
(void) fputs (_(" -M, --members USER,... set the list of members of GROUP\n"), usageout);
|
||||||
@ -226,8 +227,7 @@ static void failure (void)
|
|||||||
*/
|
*/
|
||||||
static void process_flags (int argc, char **argv)
|
static void process_flags (int argc, char **argv)
|
||||||
{
|
{
|
||||||
int flag;
|
int c;
|
||||||
int option_index = 0;
|
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"add", required_argument, NULL, 'a'},
|
{"add", required_argument, NULL, 'a'},
|
||||||
{"delete", required_argument, NULL, 'd'},
|
{"delete", required_argument, NULL, 'd'},
|
||||||
@ -236,11 +236,13 @@ static void process_flags (int argc, char **argv)
|
|||||||
{"restrict", no_argument, NULL, 'R'},
|
{"restrict", no_argument, NULL, 'R'},
|
||||||
{"administrators", required_argument, NULL, 'A'},
|
{"administrators", required_argument, NULL, 'A'},
|
||||||
{"members", required_argument, NULL, 'M'},
|
{"members", required_argument, NULL, 'M'},
|
||||||
|
{"root", required_argument, NULL, 'Q'},
|
||||||
{NULL, 0, NULL, '\0'}
|
{NULL, 0, NULL, '\0'}
|
||||||
};
|
};
|
||||||
|
|
||||||
while ((flag = getopt_long (argc, argv, "a:A:d:ghM:rR", long_options, &option_index)) != -1) {
|
while ((c = getopt_long (argc, argv, "a:A:d:ghM:Q:rR",
|
||||||
switch (flag) {
|
long_options, NULL)) != -1) {
|
||||||
|
switch (c) {
|
||||||
case 'a': /* add a user */
|
case 'a': /* add a user */
|
||||||
aflg = true;
|
aflg = true;
|
||||||
user = optarg;
|
user = optarg;
|
||||||
@ -283,6 +285,8 @@ static void process_flags (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
Mflg = true;
|
Mflg = true;
|
||||||
break;
|
break;
|
||||||
|
case 'Q': /* no-op, handled in process_root_flag () */
|
||||||
|
break;
|
||||||
case 'r': /* remove group password */
|
case 'r': /* remove group password */
|
||||||
rflg = true;
|
rflg = true;
|
||||||
break;
|
break;
|
||||||
@ -979,6 +983,8 @@ int main (int argc, char **argv)
|
|||||||
setbuf (stdout, NULL);
|
setbuf (stdout, NULL);
|
||||||
setbuf (stderr, NULL);
|
setbuf (stderr, NULL);
|
||||||
|
|
||||||
|
process_root_flag ("-Q", argc, argv);
|
||||||
|
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
is_shadowgrp = sgr_file_present ();
|
is_shadowgrp = sgr_file_present ();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user