Add nsswitch support.
[dragonfly.git] / share / man / man5 / group.5
1 .\" Copyright (c) 1980, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     From: @(#)group.5       8.3 (Berkeley) 4/19/94
33 .\" $FreeBSD: src/share/man/man5/group.5,v 1.29 2006/02/18 16:48:56 brueffer Exp $
34 .\" $DragonFly: src/share/man/man5/group.5,v 1.6 2007/04/07 19:29:52 swildner Exp $
35 .\"
36 .Dd September 29, 1994
37 .Dt GROUP 5
38 .Os
39 .Sh NAME
40 .Nm group
41 .Nd format of the group permissions file
42 .Sh DESCRIPTION
43 The
44 .Nm
45 file is the local source of group information.
46 It can be used in conjunction with the Hesiod domain
47 `group', and the NIS maps `group.byname' and `group.bygid',
48 as controlled by
49 .Xr nsswitch.conf 5 .
50 .Pp
51 The file
52 .Nm
53 consists of newline separated
54 .Tn ASCII
55 records, one per group, containing four colon
56 .Ql \&:
57 separated fields.
58 These fields are as follows:
59 .Bl -tag -width password -offset indent -compact
60 .It group
61 Name of the group.
62 .It passwd
63 Group's
64 .Em encrypted
65 password.
66 .It gid
67 The group's decimal ID.
68 .It member
69 Group members.
70 .El
71 .Pp
72 Lines whose first non-whitespace character is a pound-sign (#)
73 are comments, and are ignored.
74 Blank lines that consist
75 only of spaces, tabs or newlines are also ignored.
76 .Pp
77 The
78 .Ar group
79 field is the group name used for granting file access to users
80 who are members of the group.
81 The
82 .Ar gid
83 field is the number associated with the group name.
84 They should both be unique across the system (and often
85 across a group of systems) since they control file access.
86 The
87 .Ar passwd
88 field
89 is an optional
90 .Em encrypted
91 password.
92 This field is rarely used
93 and an asterisk is normally placed in it rather than leaving it blank.
94 The
95 .Ar member
96 field contains the names of users granted the privileges of
97 .Ar group .
98 The member names are separated by commas without spaces or newlines.
99 A user is automatically in a group if that group was specified
100 in their
101 .Pa /etc/passwd
102 entry and does not need to be added to that group in the
103 .Nm
104 file.
105 .\" .Pp
106 .\" When the system reads the file
107 .\" .Pa /etc/group
108 .\" the fields are read into the structure
109 .\" .Fa group
110 .\" declared in
111 .\" .In grp.h :
112 .\" .Bd -literal -offset indent
113 .\" struct group {
114 .\"     char    *gr_name;        /* group name */
115 .\"     char    *gr_passwd;      /* group password */
116 .\"     int     gr_gid;          /* group id */
117 .\"     char    **gr_mem;        /* group members */
118 .\" };
119 .\" .Ed
120 .Sh LIMITS
121 There are various limitations which are explained in
122 the function where they occur; see section
123 .Sx SEE ALSO .
124 .Pp
125 In older implementations,
126 a group cannot have more than 200 members.
127 The maximum line length of
128 .Pa /etc/group
129 is 1024 characters.
130 Longer lines will be skipped.
131 This limitation disappeared in
132 .Fx 3.0 .
133 Older binaries that are statically linked, depend on old
134 shared libraries, or
135 .No non- Ns Dx
136 binaries in compatibility mode
137 may still have this limit.
138 .Sh FILES
139 .Bl -tag -width /etc/group -compact
140 .It Pa /etc/group
141 .El
142 .Sh SEE ALSO
143 .Xr passwd 1 ,
144 .Xr setgroups 2 ,
145 .Xr crypt 3 ,
146 .Xr getgrent 3 ,
147 .Xr initgroups 3 ,
148 .Xr nsswitch.conf 5 ,
149 .Xr passwd 5 ,
150 .Xr chkgrp 8 ,
151 .Xr pw 8 ,
152 .Xr yp 8
153 .Sh HISTORY
154 A
155 .Nm
156 file format appeared in
157 .At v6 .
158 Support for comments first appeared in
159 .Fx 3.0 .
160 .Sh BUGS
161 The
162 .Xr passwd 1
163 command does not change the
164 .Nm
165 passwords.