1 <?xml version="1.0" encoding="UTF-8"?>
3 Copyright (c) 1992 - 1993, Julianne Frances Haugh
4 Copyright (c) 2007 - 2009, 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">
35 <refentry id='grpck.8'>
36 <!-- $Id: grpck.8.xml 3023 2009-06-20 13:02:33Z nekral-guest $ -->
38 <refentrytitle>grpck</refentrytitle>
39 <manvolnum>8</manvolnum>
40 <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
42 <refnamediv id='name'>
43 <refname>grpck</refname>
44 <refpurpose>verify integrity of group files</refpurpose>
47 <refsynopsisdiv id='synopsis'>
49 <command>grpck</command> <arg choice='opt'>-r </arg>
51 <arg choice='plain'><replaceable>group</replaceable></arg>
52 <arg choice='opt' condition="gshadow">
53 <arg choice='plain'><replaceable>shadow</replaceable></arg>
58 <command>grpck</command> <arg choice='opt'>-s </arg>
60 <arg choice='plain'><replaceable>group</replaceable></arg>
61 <arg choice='opt' condition="gshadow">
62 <arg choice='plain'><replaceable>shadow</replaceable></arg>
68 <refsect1 id='description'>
69 <title>DESCRIPTION</title>
71 The <command>grpck</command> command verifies the integrity of the
72 groups information. It checks that all entries in
73 <filename>/etc/group</filename> <phrase condition="gshadow">and
74 <filename>/etc/gshadow</filename></phrase>
75 have the proper format and contain valid data.
76 The user is prompted to delete entries that are
77 improperly formatted or which have other uncorrectable errors.
80 <para>Checks are made to verify that each entry has:</para>
82 <itemizedlist mark='bullet'>
84 <para>the correct number of fields</para>
87 <para>a unique and valid group name</para>
91 a valid group identifier
92 <phrase condition="gshadow"> (<filename>/etc/group</filename>
98 a valid list of members
99 <phrase condition="gshadow"> and administrators</phrase>
102 <listitem condition="gshadow">
104 a corresponding entry in the <filename>/etc/gshadow</filename>
105 file (respectively <filename>/etc/group</filename> for the
106 <filename>gshadow</filename> checks)
112 The checks for correct number of fields and unique group name are
113 fatal. If an entry has the wrong number of fields, the user will be
114 prompted to delete the entire line. If the user does not answer
115 affirmatively, all further checks are bypassed. An entry with a
116 duplicated group name is prompted for deletion, but the remaining
117 checks will still be made. All other errors are warnings and the user
118 is encouraged to run the <command>groupmod</command> command to
123 The commands which operate on the <filename>/etc/group</filename>
124 <phrase condition="no_gshadow">file</phrase><phrase
125 condition="gshadow">and <filename>/etc/gshadow</filename> files</phrase>
126 are not able to alter corrupted or duplicated entries.
127 <command>grpck</command> should be used in those circumstances to
128 remove the offending entries.
132 <refsect1 id='options'>
133 <title>OPTIONS</title>
135 The options which apply to the <command>grpck</command> command are:
137 <variablelist remap='IP'>
139 <term><option>-r</option></term>
142 Execute the <command>grpck</command> command in read-only mode.
143 This causes all questions regarding changes to be answered
144 <emphasis>no</emphasis> without user intervention.
149 <term><option>-s</option></term>
152 Sort entries in <filename>/etc/group</filename>
153 <phrase condition="gshadow">and
154 <filename>/etc/gshadow</filename></phrase>
161 By default, <command>grpck</command> operates on
162 <filename>/etc/group</filename><phrase condition="gshadow"> and
163 <filename>/etc/gshadow</filename></phrase>.
164 The user may select alternate files with the <emphasis
165 remap='I'>group</emphasis>
166 <phrase condition="no_gshadow">parameter.</phrase>
167 <phrase condition="gshadow">and <emphasis remap='I'>shadow</emphasis>
172 <refsect1 id='configuration'>
173 <title>CONFIGURATION</title>
175 The following configuration variables in
176 <filename>/etc/login.defs</filename> change the behavior of this
180 &MAX_MEMBERS_PER_GROUP;
184 <refsect1 id='files'>
188 <term><filename>/etc/group</filename></term>
190 <para>Group account information.</para>
193 <varlistentry condition="gshadow">
194 <term><filename>/etc/gshadow</filename></term>
196 <para>Secure group account information.</para>
200 <term><filename>/etc/passwd</filename></term>
202 <para>User account information.</para>
208 <refsect1 id='exit_values'>
209 <title>EXIT VALUES</title>
211 The <command>grpck</command> command exits with the following values:
214 <term><replaceable>0</replaceable></term>
220 <term><replaceable>1</replaceable></term>
222 <para>invalid command syntax</para>
226 <term><replaceable>2</replaceable></term>
228 <para>one or more bad group entries</para>
232 <term><replaceable>3</replaceable></term>
234 <para>can't open group files</para>
238 <term><replaceable>4</replaceable></term>
240 <para>can't lock group files</para>
244 <term><replaceable>5</replaceable></term>
246 <para>can't update group files</para>
253 <refsect1 id='see_also'>
254 <title>SEE ALSO</title>
257 <refentrytitle>group</refentrytitle><manvolnum>5</manvolnum>
260 <refentrytitle>groupmod</refentrytitle><manvolnum>8</manvolnum>
262 <phrase condition="gshadow">
264 <refentrytitle>gshadow</refentrytitle><manvolnum>5</manvolnum>,
268 <refentrytitle>passwd</refentrytitle><manvolnum>5</manvolnum>
271 <refentrytitle>pwck</refentrytitle><manvolnum>8</manvolnum>
274 <refentrytitle>shadow</refentrytitle><manvolnum>5</manvolnum>