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