1 <?xml version="1.0" encoding="UTF-8"?>
3 Copyright (c) 1992 - 1993, Julianne Frances Haugh
4 Copyright (c) 2007 - 2011, Nicolas François
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15 3. The name of the copyright holders or contributors may not be used to
16 endorse or promote products derived from this software without
17 specific prior written permission.
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN"
32 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
33 <!ENTITY MAX_MEMBERS_PER_GROUP SYSTEM "login.defs.d/MAX_MEMBERS_PER_GROUP.xml">
34 <!-- SHADOW-CONFIG-HERE -->
36 <refentry id='grpck.8'>
40 <firstname>Julianne Frances</firstname>
41 <surname>Haugh</surname>
42 <contrib>Creation, 1992</contrib>
45 <firstname>Thomas</firstname>
46 <surname>Kłoczko</surname>
47 <email>kloczek@pld.org.pl</email>
48 <contrib>shadow-utils maintainer, 2000 - 2007</contrib>
51 <firstname>Nicolas</firstname>
52 <surname>François</surname>
53 <email>nicolas.francois@centraliens.net</email>
54 <contrib>shadow-utils maintainer, 2007 - now</contrib>
58 <refentrytitle>grpck</refentrytitle>
59 <manvolnum>8</manvolnum>
60 <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
61 <refmiscinfo class="source">shadow-utils</refmiscinfo>
62 <refmiscinfo class="version">&SHADOW_UTILS_VERSION;</refmiscinfo>
64 <refnamediv id='name'>
65 <refname>grpck</refname>
66 <refpurpose>verify integrity of group files</refpurpose>
69 <refsynopsisdiv id='synopsis'>
71 <command>grpck</command>
72 <arg choice='opt'>options</arg>
74 <arg choice='plain'><replaceable>group</replaceable></arg>
75 <arg choice='opt' condition="gshadow">
76 <arg choice='plain'><replaceable>shadow</replaceable></arg>
82 <refsect1 id='description'>
83 <title>DESCRIPTION</title>
85 The <command>grpck</command> command verifies the integrity of the
86 groups information. It checks that all entries in
87 <filename>/etc/group</filename> <phrase condition="gshadow">and
88 <filename>/etc/gshadow</filename></phrase>
89 have the proper format and contain valid data.
90 The user is prompted to delete entries that are
91 improperly formatted or which have other uncorrectable errors.
94 <para>Checks are made to verify that each entry has:</para>
96 <itemizedlist mark='bullet'>
98 <para>the correct number of fields</para>
101 <para>a unique and valid group name</para>
105 a valid group identifier
106 <phrase condition="gshadow"> (<filename>/etc/group</filename>
112 a valid list of members
113 <phrase condition="gshadow"> and administrators</phrase>
116 <listitem condition="gshadow">
118 a corresponding entry in the <filename>/etc/gshadow</filename>
119 file (respectively <filename>/etc/group</filename> for the
120 <filename>gshadow</filename> checks)
126 The checks for correct number of fields and unique group name are
127 fatal. If an entry has the wrong number of fields, the user will be
128 prompted to delete the entire line. If the user does not answer
129 affirmatively, all further checks are bypassed. An entry with a
130 duplicated group name is prompted for deletion, but the remaining
131 checks will still be made. All other errors are warnings and the user
132 is encouraged to run the <command>groupmod</command> command to
137 The commands which operate on the <filename>/etc/group</filename>
138 <phrase condition="no_gshadow">file</phrase><phrase
139 condition="gshadow">and <filename>/etc/gshadow</filename> files</phrase>
140 are not able to alter corrupted or duplicated entries.
141 <command>grpck</command> should be used in those circumstances to
142 remove the offending entries.
146 <refsect1 id='options'>
147 <title>OPTIONS</title>
149 The <option>-r</option> and <option>-s</option> options cannot be
153 The options which apply to the <command>grpck</command> command are:
155 <variablelist remap='IP'>
157 <term><option>-h</option>, <option>--help</option></term>
159 <para>Display help message and exit.</para>
163 <term><option>-r</option>, <option>--read-only</option></term>
166 Execute the <command>grpck</command> command in read-only mode.
167 This causes all questions regarding changes to be answered
168 <emphasis>no</emphasis> without user intervention.
174 <option>-R</option>, <option>--root</option> <replaceable>CHROOT_DIR</replaceable>
178 Apply changes in the <replaceable>CHROOT_DIR</replaceable>
179 directory and use the configuration files from the
180 <replaceable>CHROOT_DIR</replaceable> directory.
185 <term><option>-s</option>, <option>--sort</option></term>
188 Sort entries in <filename>/etc/group</filename>
189 <phrase condition="gshadow">and
190 <filename>/etc/gshadow</filename></phrase>
197 By default, <command>grpck</command> operates on
198 <filename>/etc/group</filename> <phrase condition="gshadow">and
199 <filename>/etc/gshadow</filename></phrase>.
200 The user may select alternate files with the <emphasis
201 remap='I'>group</emphasis>
202 <phrase condition="no_gshadow">parameter.</phrase>
203 <phrase condition="gshadow">and <emphasis remap='I'>shadow</emphasis>
208 <refsect1 id='configuration'>
209 <title>CONFIGURATION</title>
211 The following configuration variables in
212 <filename>/etc/login.defs</filename> change the behavior of this
216 &MAX_MEMBERS_PER_GROUP;
220 <refsect1 id='files'>
224 <term><filename>/etc/group</filename></term>
226 <para>Group account information.</para>
229 <varlistentry condition="gshadow">
230 <term><filename>/etc/gshadow</filename></term>
232 <para>Secure group account information.</para>
236 <term><filename>/etc/passwd</filename></term>
238 <para>User account information.</para>
244 <refsect1 id='exit_values'>
245 <title>EXIT VALUES</title>
247 The <command>grpck</command> command exits with the following values:
250 <term><replaceable>0</replaceable></term>
256 <term><replaceable>1</replaceable></term>
258 <para>invalid command syntax</para>
262 <term><replaceable>2</replaceable></term>
264 <para>one or more bad group entries</para>
268 <term><replaceable>3</replaceable></term>
270 <para>can't open group files</para>
274 <term><replaceable>4</replaceable></term>
276 <para>can't lock group files</para>
280 <term><replaceable>5</replaceable></term>
282 <para>can't update group files</para>
289 <refsect1 id='see_also'>
290 <title>SEE ALSO</title>
293 <refentrytitle>group</refentrytitle><manvolnum>5</manvolnum>
296 <refentrytitle>groupmod</refentrytitle><manvolnum>8</manvolnum>
298 <phrase condition="gshadow">
300 <refentrytitle>gshadow</refentrytitle><manvolnum>5</manvolnum>,
304 <refentrytitle>passwd</refentrytitle><manvolnum>5</manvolnum>
307 <refentrytitle>pwck</refentrytitle><manvolnum>8</manvolnum>
310 <refentrytitle>shadow</refentrytitle><manvolnum>5</manvolnum>