summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/list_devices.1
blob: 3498c54ced415c875bd61610f2f4c359aaa0a618 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
'\" te
.\" Copyright 2007 Sun Microsystems, Inc. All Rights Reserved
.\" 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.
.\" 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.
.\" 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]
.TH LIST_DEVICES 1 "Mar 6, 2017"
.SH NAME
list_devices \- list allocatable devices
.SH SYNOPSIS
.LP
.nf
\fBlist_devices\fR [\fB-s\fR] [\fB-U\fR \fIuid\fR] [\fB-z\fR \fIzonename\fR] [\fB-a\fR [\fB-w\fR]]
     \fB-l\fR | \fB-n\fR | \fB-u\fR [\fIdevice\fR] | [\fB-l\fR | \fB-n\fR | \fB-u\fR] \fB-c\fR \fIdev-class\fR
.fi

.LP
.nf
\fBlist_devices\fR [\fB-s\fR] \fB-d\fR \fIdev-type\fR
.fi

.SH DESCRIPTION
.LP
The \fBlist_devices\fR utility lists the allocatable devices in the system
according to specified qualifications.
.sp
.LP
The \fIdevice\fR and all device special files associated with the device are
listed. The device argument is optional and, if it is not present, all relevant
devices are listed. If \fIdev-class\fR is present, devices belonging to the
specified \fIdev-class\fR are listed. There is no default \fIdev-class\fR.
.SH OPTIONS
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-l\fR [\fB-c\fR \fIdev-class\fR | \fIdevice\fR]\fR
.ad
.RS 30n
Lists the pathnames of the device special files associated with the
\fIdevice\fR that are allocatable to the current process.
.sp
If \fIdev-class\fR is specified, lists only the files associated with all
devices of the specified device class.
.sp
If \fIdevice\fR is specified, lists only the files associated with the
specified device.
.RE

.sp
.ne 2
.na
\fB\fB-n\fR [\fB-c\fR \fIdev-class\fR | \fIdevice\fR]\fR
.ad
.RS 30n
Lists the pathnames of the device special files associated with the device that
are allocatable to the current process but are not currently allocated.
.sp
If \fIdev-class\fR is specified, lists only the files associated with all
devices of the specified device class.
.sp
If \fIdevice\fR is specified, lists only the files associated with the
specified device.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR\fR
.ad
.RS 30n
Silent. Suppresses any diagnostic output.
.RE

.sp
.ne 2
.na
\fB\fB-u\fR [\fB-c\fR \fIdev-class\fR | \fIdevice\fR]\fR
.ad
.RS 30n
Lists the pathnames of device special files associated with the device that are
allocated to the owner of the current process.
.sp
If \fIdev-class\fR is specified, lists only the files associated with all
devices of the specified device class.
.sp
If \fIdevice\fR is specified, lists only the files associated with the
specified device.
.RE

.sp
.ne 2
.na
\fB\fB-U\fR \fIuid\fR\fR
.ad
.RS 30n
Uses the user \fBID\fR \fIuid\fR instead of the real user \fBID\fR of the
current process when performing the \fBlist_devices\fR operation. Only a user
with the \fBsolaris.device.revoke\fR authorization can use this option.
.RE

.sp
.LP
The following options are supported when the system is configured with Trusted
Extensions:
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.RS 15n
Lists attributes like authorizations, cleaning programs and labels associated
with a device.
.sp
The list is a single line of semicolon (\fB;\fR) separated
\fIkey\fR\fB=\fR\fIvalue\fR pairs for each device in the format:
.sp
.in +2
.nf
device=\fIdevice-name\fR;type=\fIdevice-type\fR;\e
auths=\fIauths\fR;clean=\fIdevice-exec\fR;\e
\fIdevice-attributes\fR;\e
files=\fIdevice-list\fR
.fi
.in -2
.sp

where \fIdevice-attributes\fR is the contents of the \fBreserved1\fR field of
\fBdevice_allocate\fR(4). The field is colon (\fB:\fR) separated.)
.sp
See \fBdevice_allocate\fR(4) for a description of these attributes and their
format.
.sp
The \fB-a\fR output has the following keys:
.sp
.ne 2
.na
\fB\fBauths\fR\fR
.ad
.RS 10n
Specifies the list of authorizations. The value is \fBauths\fR is described in
\fBdevice_allocate\fR(4).
.RE

.sp
.ne 2
.na
\fB\fBclean\fR\fR
.ad
.RS 10n
Specifies the device cleaning script. The value is \fBdevice-exec\fR as
described in \fBdevice_allocate\fR(4).
.RE

.sp
.ne 2
.na
\fB\fBdevice\fR\fR
.ad
.RS 10n
Specifies the device name. The value is \fBdevice-name\fR as described in
\fBdevice_allocate\fR(4).
.RE

.sp
.ne 2
.na
\fB\fBfiles\fR\fR
.ad
.RS 10n
Specifies the device file paths. The value is \fBdevice-list\fR as described in
\fBdevice_maps\fR(4).
.RE

.sp
.ne 2
.na
\fB\fBtype\fR\fR
.ad
.RS 10n
Specifies the device type. The value is \fBdevice-type\fR as described in
\fBdevice_allocate\fR(4).
.RE

.RE

.sp
.ne 2
.na
\fB\fB-d\fR\fR
.ad
.RS 15n
Displays the system-supplied default attributes for the device types managed by
device allocation. If \fIdev-type\fR is specified, it lists the default
attributes for only that device type.
.RE

.sp
.ne 2
.na
\fB\fB-w\fR\fR
.ad
.RS 15n
This option can be used with \fB-a\fR to list the current owner of the device
as the key value pair \fIowner\fR\fB=\fR\fIvalue\fR. \fIvalue\fR is the
\fBuid\fR of the current owner of the device. If the device is unallocated,
value is \fB/FREE\fR. If the device is in error state, value is \fB/ERROR\fR.
This option also suppresses any diagnostic output.
.RE

.sp
.ne 2
.na
\fB\fB-z\fR \fIzonename\fR\fR
.ad
.RS 15n
When specified with the \fB-l\fR option, lists only those non-allocated devices
whose label range includes the label of the zonename, and of the allocated
devices, only those that are allocated at the same label as that of
\fIzonename\fR.
.sp
When specified with the \fB-n\fR option, lists only those non-allocated devices
whose label range includes the label of the \fIzonename\fR.
.sp
When specified with the \fB-u\fR option, lists only those devices that are
allocated at the same label as that of \fIzonename\fR.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRListing All Devices
.sp
.LP
The following example lists all devices available to the caller for allocation:

.sp
.in +2
.nf
% list_devices -l
device: audio type: audio \e
files: /dev/audio /dev/audioctl /dev/sound/0 /dev/sound/0ctl
.fi
.in -2
.sp

.LP
\fBExample 2 \fRListing Attributes of All Devices
.sp
.LP
On a system configured with Trusted Extensions, the following example lists
attributes of all devices available to the caller for allocation:

.sp
.in +2
.nf
% list_devices -al
device=audio1;type=audio;\e
auths=solaris.device.allocate;\e
clean=/etc/security/lib/audio_clean;\e
minlabel=admin_low:maxlabel=admin_high;\e
files=/dev/audio1 /dev/audio1ctl /dev/sound/1 /dev/sound/1ctl
.fi
.in -2
.sp

.LP
\fBExample 3 \fRListing Attributes Including the Device Owner
.sp
.LP
On a system configured with Trusted Extensions, the following example lists
attributes including the device owner of all devices allocated to the user:

.sp
.in +2
.nf
% list_devices -auw
device=audio2;type=audio;auths=solaris.device.allocate;\e
clean=/etc/security/lib/audio_clean;\e
minlabel=admin_low:maxlabel=admin_high:zone=public;\e
owner=1234;\e
files=/dev/audio2 /dev/audio2ctl /dev/sound/2 /dev/sound/2ctl
.fi
.in -2
.sp

.SH EXIT STATUS
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 15n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB20\fR\fR
.ad
.RS 15n
No entry for the specified device.
.RE

.sp
.ne 2
.na
\fB\fIother value\fR\fR
.ad
.RS 15n
An error occurred.
.RE

.SH FILES
.LP
\fB/etc/security/device_allocate\fR
.sp
.LP
\fB/etc/security/device_maps\fR
.sp
.LP
\fB/etc/security/dev/*\fR
.sp
.LP
\fB/usr/security/lib/*\fR
.SH ATTRIBUTES
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	See below.
.TE

.sp
.LP
The invocation is Uncommitted. The options are Uncommitted. The output from the
\fB-a\fR and \fB-w\fR options is Uncommitted. All other output is
Not-an-Interface.
.SH SEE ALSO
.LP
\fBallocate\fR(1), \fBdeallocate\fR(1), \fBdminfo\fR(1M),
\fBmkdevalloc\fR(1M), \fBmkdevmaps\fR(1M), \fBdevice_allocate\fR(4),
\fBdevice_maps\fR(4), \fBattributes\fR(5)
.SH NOTES
.LP
On systems configured with Trusted Extensions, the functionality is enabled by
default.
.sp
.LP
\fB/etc/security/dev\fR, \fBmkdevalloc\fR(1M), and \fBmkdevmaps\fR(1M) might
not be supported in a future release of the Solaris Operating Environment.