add -U option to groupadd and groupmod

Add a -U option which adds new usernames as members.  For groupmod,
also add -a (append), without which existing members are removed.

Closes #265
This commit is contained in:
Serge Hallyn
2020-08-09 16:44:30 -05:00
parent 7ea342579e
commit 342c934a35
6 changed files with 147 additions and 10 deletions

View File

@@ -229,6 +229,22 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-U</option>, <option>--users</option>
</term>
<listitem>
<para>
A list of usernames to add as members of the group.
</para>
<para>
The default behavior (if the <option>-g</option>,
<option>-N</option>, and <option>-U</option> options are not
specified) is defined by the <option>USERGROUPS_ENAB</option>
variable in <filename>/etc/login.defs</filename>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

View File

@@ -93,6 +93,15 @@
</para>
<variablelist remap='IP'>
<varlistentry>
<term>
<option>-a</option>, <option>--append</option>&nbsp;<replaceable>GID</replaceable>
</term>
<listitem>
<para>If group members are specified with -U, append them to the existing
member list, rather than replacing it.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-g</option>, <option>--gid</option>&nbsp;<replaceable>GID</replaceable>
</term>
@@ -203,6 +212,22 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-U</option>, <option>--users</option>
</term>
<listitem>
<para>
A list of usernames to add as members of the group.
</para>
<para>
The default behavior (if the <option>-g</option>,
<option>-N</option>, and <option>-U</option> options are not
specified) is defined by the <option>USERGROUPS_ENAB</option>
variable in <filename>/etc/login.defs</filename>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>