Print this page
3243 Add shadow support to getent(1)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1m/getent.1m
+++ new/usr/src/man/man1m/getent.1m
1 1 '\" te
2 2 .\" Copyright (C) 1999, Sun Microsystems, Inc. All Rights Reserved
3 3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 6 .TH GETENT 1M "Mar 26, 2007"
7 7 .SH NAME
8 8 getent \- get entries from administrative database
9 9 .SH SYNOPSIS
10 10 .LP
11 11 .nf
12 12 \fBgetent\fR \fIdatabase\fR [\fIkey\fR]...
13 13 .fi
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14
15 15 .SH DESCRIPTION
16 16 .sp
17 17 .LP
18 18 \fBgetent\fR gets a list of entries from the administrative database specified
19 19 by \fIdatabase\fR. The information generally comes from one or more of the
20 20 sources that are specified for the \fIdatabase\fR in \fB/etc/nsswitch.conf\fR.
21 21 .sp
22 22 .LP
23 23 \fIdatabase\fR is the name of the database to be examined. This can be
24 -\fBpasswd\fR, \fBgroup\fR, \fBhosts\fR, \fBipnodes\fR, \fBservices\fR,
24 +\fBpasswd\fR, \fBshadow\fR, \fBgroup\fR, \fBhosts\fR, \fBipnodes\fR, \fBservices\fR,
25 25 \fBprotocols\fR, \fBethers\fR, \fBproject\fR, \fBnetworks\fR, or
26 26 \fBnetmasks\fR. For each of these databases, \fBgetent\fR uses the appropriate
27 -library routines described in \fBgetpwnam\fR(3C), \fBgetgrnam\fR(3C),
27 +library routines described in \fBgetpwnam\fR(3C), \fBgetspnam\fR(3C), \fBgetgrnam\fR(3C),
28 28 \fBgethostbyaddr\fR(3NSL), \fBgethostbyname\fR(3NSL),
29 29 \fBgetipnodebyaddr\fR(3SOCKET), \fBgetipnodebyname\fR(3SOCKET),
30 30 \fBgetservbyname\fR(3SOCKET), \fBgetprotobyname\fR(3SOCKET),
31 31 \fBethers\fR(3SOCKET), \fBgetprojbyname\fR(3PROJECT) and
32 32 \fBgetnetbyname\fR(3SOCKET), respectively.
33 33 .sp
34 34 .LP
35 35 Each \fIkey\fR must be in a format appropriate for searching on the respective
36 36 database. For example, it can be a \fIusername\fR or \fInumeric-uid\fR for
37 37 \fBpasswd\fR; \fIhostname\fR or \fIIP\fR \fIaddress\fR for \fBhosts\fR; or
38 38 \fIservice\fR, \fIservice/protocol\fR, \fIport\fR, or \fIport/proto\fR for
39 39 \fBservices\fR.
40 40 .sp
41 41 .LP
42 42 \fBgetent\fR prints out the database entries that match each of the supplied
43 43 keys, one per line, in the format of the matching administrative file:
44 -\fBpasswd\fR(4), \fBgroup\fR(4), \fBproject\fR(4), \fBhosts\fR(4),
44 +\fBpasswd\fR(4), \fBshadow\fR(4), \fBgroup\fR(4), \fBproject\fR(4), \fBhosts\fR(4),
45 45 \fBservices\fR(4), \fBprotocols\fR(4), \fBethers\fR(3SOCKET),
46 46 \fBnetworks\fR(4), or \fBnetmasks\fR(4). If no key is given, all entries
47 47 returned by the corresponding enumeration library routine, for example,
48 48 \fBgetpwent()\fR or \fBgethostent()\fR, are printed. Enumeration is not
49 49 supported on \fBipnodes\fR.
50 50 .SS "Key Interpretation for \fBpasswd\fR and \fBgroup\fR Databases"
51 51 .sp
52 52 .LP
53 53 When \fBgetent\fR is invoked with database set to \fBpasswd\fR, each key value
54 54 is processed as follows:
55 55 .RS +4
56 56 .TP
57 57 .ie t \(bu
58 58 .el o
59 59 If the key value consists only of numeric characters, \fBgetent\fR assumes that
60 60 the key value is a numeric user ID and searches the user database for a
61 61 matching user ID.
62 62 .RE
63 63 .RS +4
64 64 .TP
65 65 .ie t \(bu
66 66 .el o
67 67 If the user ID is not found in the user database or if the key value contains
68 68 any non-numeric characters, \fBgetent\fR assumes the key value is a user name
69 69 and searches the user database for a matching user name.
70 70 .RE
71 71 .sp
72 72 .LP
73 73 Similarly, when \fBgetent\fR is invoked with database set to \fBgroup\fR, each
74 74 key value is processed as follows:
75 75 .RS +4
76 76 .TP
77 77 .ie t \(bu
78 78 .el o
79 79 If the key value consists only of numeric characters, \fBgetent\fR assumes that
80 80 the key value is a numeric group ID and searches the group database for a
81 81 matching group ID.
82 82 .RE
83 83 .RS +4
84 84 .TP
85 85 .ie t \(bu
86 86 .el o
87 87 If the group ID is not found in the \fBgroup\fR database or if the key value
88 88 contains any non-numeric characters, \fBgetent\fR assumes the key value is a
89 89 group name and searches the \fBgroup\fR database for a matching group name.
90 90 .RE
91 91 .SH EXIT STATUS
92 92 .sp
93 93 .LP
94 94 The following exit values are returned:
95 95 .sp
96 96 .ne 2
97 97 .na
98 98 \fB\fB0\fR\fR
99 99 .ad
100 100 .RS 5n
101 101 Successful completion.
102 102 .RE
103 103
104 104 .sp
105 105 .ne 2
106 106 .na
107 107 \fB\fB1\fR\fR
108 108 .ad
109 109 .RS 5n
110 110 Command syntax was incorrect, an invalid option was used, or an internal error
111 111 occurred.
112 112 .RE
113 113
114 114 .sp
115 115 .ne 2
116 116 .na
117 117 \fB\fB2\fR\fR
118 118 .ad
119 119 .RS 5n
120 120 At least one of the specified entry names was not found in the database.
121 121 .RE
122 122
123 123 .sp
124 124 .ne 2
125 125 .na
126 126 \fB\fB3\fR\fR
127 127 .ad
128 128 .RS 5n
129 129 There is no support for enumeration on this database.
130 130 .RE
131 131
132 132 .SH FILES
133 133 .sp
134 134 .ne 2
135 135 .na
136 136 \fB\fB/etc/nsswitch.conf\fR\fR
137 137 .ad
138 138 .RS 22n
139 139 name service switch configuration file
140 140 .RE
141 141
142 142 .sp
143 143 .ne 2
↓ open down ↓ |
89 lines elided |
↑ open up ↑ |
144 144 .na
145 145 \fB\fB/etc/passwd\fR\fR
146 146 .ad
147 147 .RS 22n
148 148 password file
149 149 .RE
150 150
151 151 .sp
152 152 .ne 2
153 153 .na
154 +\fB\fB/etc/shadow\fR\fR
155 +.ad
156 +.RS 22n
157 +shadowed password file
158 +.RE
159 +
160 +.sp
161 +.ne 2
162 +.na
154 163 \fB\fB/etc/group\fR\fR
155 164 .ad
156 165 .RS 22n
157 166 group file
158 167 .RE
159 168
160 169 .sp
161 170 .ne 2
162 171 .na
163 172 \fB\fB/etc/inet/hosts\fR\fR
164 173 .ad
165 174 .RS 22n
166 175 IPv4 and IPv6 host name database
167 176 .RE
168 177
169 178 .sp
170 179 .ne 2
171 180 .na
172 181 \fB\fB/etc/services\fR\fR
173 182 .ad
174 183 .RS 22n
175 184 Internet services and aliases
176 185 .RE
177 186
178 187 .sp
179 188 .ne 2
180 189 .na
181 190 \fB\fB/etc/project\fR\fR
182 191 .ad
183 192 .RS 22n
184 193 project file
185 194 .RE
186 195
187 196 .sp
188 197 .ne 2
189 198 .na
190 199 \fB\fB/etc/protocols\fR\fR
191 200 .ad
192 201 .RS 22n
193 202 protocol name database
194 203 .RE
195 204
196 205 .sp
197 206 .ne 2
198 207 .na
199 208 \fB\fB/etc/ethers\fR\fR
200 209 .ad
201 210 .RS 22n
202 211 Ethernet address to hostname database or domain
203 212 .RE
204 213
205 214 .sp
206 215 .ne 2
207 216 .na
208 217 \fB\fB/etc/networks\fR\fR
209 218 .ad
210 219 .RS 22n
211 220 network name database
212 221 .RE
213 222
214 223 .sp
215 224 .ne 2
216 225 .na
217 226 \fB\fB/etc/netmasks\fR\fR
218 227 .ad
219 228 .RS 22n
220 229 network mask database
221 230 .RE
222 231
223 232 .SH SEE ALSO
224 233 .sp
225 234 .LP
226 235 \fBethers\fR(3SOCKET), \fBgetgrnam\fR(3C), \fBgethostbyaddr\fR(3NSL),
227 236 \fBgethostbyname\fR(3NSL), \fBgethostent\fR(3NSL),
228 237 \fBgetipnodebyaddr\fR(3SOCKET), \fBgetipnodebyname\fR(3SOCKET),
229 238 \fBgetnetbyname\fR(3SOCKET), \fBgetprojbyname\fR(3PROJECT),
230 239 \fBgetprotobyname\fR(3SOCKET), \fBgetpwnam\fR(3C),
231 240 \fBgetservbyname\fR(3SOCKET), \fBgroup\fR(4), \fBhosts\fR(4),
232 241 \fBnetmasks\fR(4), \fBnetworks\fR(4), \fBnsswitch.conf\fR(4), \fBpasswd\fR(4),
233 242 \fBproject\fR(4), \fBprotocols\fR(4), \fBservices\fR(4), \fBattributes\fR(5)
↓ open down ↓ |
70 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX