2 .\" Copyright 2007 Sun Microsystems, Inc. All Rights Reserved
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 .\" 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 .\" 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 LIST_DEVICES 1 "Mar 6, 2017"
8 list_devices \- list allocatable devices
12 \fBlist_devices\fR [\fB-s\fR] [\fB-U\fR \fIuid\fR] [\fB-z\fR \fIzonename\fR] [\fB-a\fR [\fB-w\fR]]
13 \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
18 \fBlist_devices\fR [\fB-s\fR] \fB-d\fR \fIdev-type\fR
23 The \fBlist_devices\fR utility lists the allocatable devices in the system
24 according to specified qualifications.
27 The \fIdevice\fR and all device special files associated with the device are
28 listed. The device argument is optional and, if it is not present, all relevant
29 devices are listed. If \fIdev-class\fR is present, devices belonging to the
30 specified \fIdev-class\fR are listed. There is no default \fIdev-class\fR.
33 The following options are supported:
37 \fB\fB-l\fR [\fB-c\fR \fIdev-class\fR | \fIdevice\fR]\fR
40 Lists the pathnames of the device special files associated with the
41 \fIdevice\fR that are allocatable to the current process.
43 If \fIdev-class\fR is specified, lists only the files associated with all
44 devices of the specified device class.
46 If \fIdevice\fR is specified, lists only the files associated with the
53 \fB\fB-n\fR [\fB-c\fR \fIdev-class\fR | \fIdevice\fR]\fR
56 Lists the pathnames of the device special files associated with the device that
57 are allocatable to the current process but are not currently allocated.
59 If \fIdev-class\fR is specified, lists only the files associated with all
60 devices of the specified device class.
62 If \fIdevice\fR is specified, lists only the files associated with the
72 Silent. Suppresses any diagnostic output.
78 \fB\fB-u\fR [\fB-c\fR \fIdev-class\fR | \fIdevice\fR]\fR
81 Lists the pathnames of device special files associated with the device that are
82 allocated to the owner of the current process.
84 If \fIdev-class\fR is specified, lists only the files associated with all
85 devices of the specified device class.
87 If \fIdevice\fR is specified, lists only the files associated with the
94 \fB\fB-U\fR \fIuid\fR\fR
97 Uses the user \fBID\fR \fIuid\fR instead of the real user \fBID\fR of the
98 current process when performing the \fBlist_devices\fR operation. Only a user
99 with the \fBsolaris.device.revoke\fR authorization can use this option.
104 The following options are supported when the system is configured with Trusted
112 Lists attributes like authorizations, cleaning programs and labels associated
115 The list is a single line of semicolon (\fB;\fR) separated
116 \fIkey\fR\fB=\fR\fIvalue\fR pairs for each device in the format:
120 device=\fIdevice-name\fR;type=\fIdevice-type\fR;\e
121 auths=\fIauths\fR;clean=\fIdevice-exec\fR;\e
122 \fIdevice-attributes\fR;\e
123 files=\fIdevice-list\fR
128 where \fIdevice-attributes\fR is the contents of the \fBreserved1\fR field of
129 \fBdevice_allocate\fR(4). The field is colon (\fB:\fR) separated.)
131 See \fBdevice_allocate\fR(4) for a description of these attributes and their
134 The \fB-a\fR output has the following keys:
141 Specifies the list of authorizations. The value is \fBauths\fR is described in
142 \fBdevice_allocate\fR(4).
151 Specifies the device cleaning script. The value is \fBdevice-exec\fR as
152 described in \fBdevice_allocate\fR(4).
161 Specifies the device name. The value is \fBdevice-name\fR as described in
162 \fBdevice_allocate\fR(4).
171 Specifies the device file paths. The value is \fBdevice-list\fR as described in
172 \fBdevice_maps\fR(4).
181 Specifies the device type. The value is \fBdevice-type\fR as described in
182 \fBdevice_allocate\fR(4).
193 Displays the system-supplied default attributes for the device types managed by
194 device allocation. If \fIdev-type\fR is specified, it lists the default
195 attributes for only that device type.
204 This option can be used with \fB-a\fR to list the current owner of the device
205 as the key value pair \fIowner\fR\fB=\fR\fIvalue\fR. \fIvalue\fR is the
206 \fBuid\fR of the current owner of the device. If the device is unallocated,
207 value is \fB/FREE\fR. If the device is in error state, value is \fB/ERROR\fR.
208 This option also suppresses any diagnostic output.
214 \fB\fB-z\fR \fIzonename\fR\fR
217 When specified with the \fB-l\fR option, lists only those non-allocated devices
218 whose label range includes the label of the zonename, and of the allocated
219 devices, only those that are allocated at the same label as that of
222 When specified with the \fB-n\fR option, lists only those non-allocated devices
223 whose label range includes the label of the \fIzonename\fR.
225 When specified with the \fB-u\fR option, lists only those devices that are
226 allocated at the same label as that of \fIzonename\fR.
231 \fBExample 1 \fRListing All Devices
234 The following example lists all devices available to the caller for allocation:
240 device: audio type: audio \e
241 files: /dev/audio /dev/audioctl /dev/sound/0 /dev/sound/0ctl
247 \fBExample 2 \fRListing Attributes of All Devices
250 On a system configured with Trusted Extensions, the following example lists
251 attributes of all devices available to the caller for allocation:
257 device=audio1;type=audio;\e
258 auths=solaris.device.allocate;\e
259 clean=/etc/security/lib/audio_clean;\e
260 minlabel=admin_low:maxlabel=admin_high;\e
261 files=/dev/audio1 /dev/audio1ctl /dev/sound/1 /dev/sound/1ctl
267 \fBExample 3 \fRListing Attributes Including the Device Owner
270 On a system configured with Trusted Extensions, the following example lists
271 attributes including the device owner of all devices allocated to the user:
277 device=audio2;type=audio;auths=solaris.device.allocate;\e
278 clean=/etc/security/lib/audio_clean;\e
279 minlabel=admin_low:maxlabel=admin_high:zone=public;\e
281 files=/dev/audio2 /dev/audio2ctl /dev/sound/2 /dev/sound/2ctl
288 The following exit values are returned:
295 Successful completion.
304 No entry for the specified device.
310 \fB\fIother value\fR\fR
318 \fB/etc/security/device_allocate\fR
321 \fB/etc/security/device_maps\fR
324 \fB/etc/security/dev/*\fR
327 \fB/usr/security/lib/*\fR
330 See \fBattributes\fR(5) for descriptions of the following attributes:
338 ATTRIBUTE TYPE ATTRIBUTE VALUE
340 Interface Stability See below.
345 The invocation is Uncommitted. The options are Uncommitted. The output from the
346 \fB-a\fR and \fB-w\fR options is Uncommitted. All other output is
350 \fBallocate\fR(1), \fBdeallocate\fR(1), \fBdminfo\fR(1M),
351 \fBmkdevalloc\fR(1M), \fBmkdevmaps\fR(1M), \fBdevice_allocate\fR(4),
352 \fBdevice_maps\fR(4), \fBattributes\fR(5)
355 On systems configured with Trusted Extensions, the functionality is enabled by
359 \fB/etc/security/dev\fR, \fBmkdevalloc\fR(1M), and \fBmkdevmaps\fR(1M) might
360 not be supported in a future release of the Solaris Operating Environment.