1list_devices(1)                  User Commands                 list_devices(1)
2
3
4

NAME

6       list_devices - list allocatable devices
7

SYNOPSIS

9       list_devices [-s] [-U uid] [-z zonename] [-a [-w]]
10            -l | -n | -u [device] | [-l | -n | -u] -c dev-class
11
12
13       list_devices [-s] -d dev-type
14
15

DESCRIPTION

17       The  list_devices  utility  lists the allocatable devices in the system
18       according to specified qualifications.
19
20
21       The device and all device special files associated with the device  are
22       listed.  The device argument is optional and, if it is not present, all
23       relevant devices are listed. If dev-class is present, devices belonging
24       to the specified dev-class are listed. There is no default dev-class.
25

OPTIONS

27       The following options are supported:
28
29       -l [-c dev-class | device]    Lists the pathnames of the device special
30                                     files associated with the device that are
31                                     allocatable to the current process.
32
33                                     If dev-class is specified, lists only the
34                                     files associated with all devices of  the
35                                     specified device class.
36
37                                     If  device  is  specified, lists only the
38                                     files  associated  with   the   specified
39                                     device.
40
41
42       -n [-c dev-class | device]    Lists the pathnames of the device special
43                                     files associated with the device that are
44                                     allocatable  to  the  current process but
45                                     are not currently allocated.
46
47                                     If dev-class is specified, lists only the
48                                     files  associated with all devices of the
49                                     specified device class.
50
51                                     If device is specified,  lists  only  the
52                                     files   associated   with  the  specified
53                                     device.
54
55
56       -s                            Silent. Suppresses any diagnostic output.
57
58
59       -u [-c dev-class | device]    Lists the  pathnames  of  device  special
60                                     files associated with the device that are
61                                     allocated to the  owner  of  the  current
62                                     process.
63
64                                     If dev-class is specified, lists only the
65                                     files associated with all devices of  the
66                                     specified device class.
67
68                                     If  device  is  specified, lists only the
69                                     files  associated  with   the   specified
70                                     device.
71
72
73       -U uid                        Uses  the user ID uid instead of the real
74                                     user ID of the current process when  per‐
75                                     forming  the list_devices operation. Only
76                                     a  user  with  the  solaris.device.revoke
77                                     authorization can use this option.
78
79
80
81       The  following options are supported when the system is configured with
82       Trusted Extensions:
83
84       -a             Lists attributes like authorizations, cleaning  programs
85                      and labels associated with a device.
86
87                      The  list  is  a  single line of semicolon (;) separated
88                      key=value pairs for each device in the format:
89
90                        device=device-name;type=device-type;\
91                        auths=auths;clean=device-exec;\
92                        device-attributes;\
93                        files=device-list
94
95
96                      where device-attributes is the contents of the reserved1
97                      field of device_allocate(4). The field is colon (:) sep‐
98                      arated.)
99
100                      See  device_allocate(4)  for  a  description  of   these
101                      attributes and their format.
102
103                      The -a output has the following keys:
104
105                      auths     Specifies  the  list  of  authorizations.  The
106                                value is auths is  described  in  device_allo‐
107                                cate(4).
108
109
110                      clean     Specifies  the  device  cleaning  script.  The
111                                value   is   device-exec   as   described   in
112                                device_allocate(4).
113
114
115                      device    Specifies   the  device  name.  The  value  is
116                                device-name  as  described   in   device_allo‐
117                                cate(4).
118
119
120                      files     Specifies  the device file paths. The value is
121                                device-list as described in device_maps(4).
122
123
124                      type      Specifies  the  device  type.  The  value   is
125                                device-type   as   described  in  device_allo‐
126                                cate(4).
127
128
129
130       -d             Displays the system-supplied default attributes for  the
131                      device  types  managed by device allocation. If dev-type
132                      is specified, it lists the default attributes  for  only
133                      that device type.
134
135
136       -w             This  option  can  be  used  with -a to list the current
137                      owner of the device as the key value  pair  owner=value.
138                      value  is the uid of the current owner of the device. If
139                      the device is unallocated, value is /FREE. If the device
140                      is  in  error  state,  value is /ERROR. This option also
141                      suppresses any diagnostic output.
142
143
144       -z zonename    When specified with the -l option, lists only those non-
145                      allocated  devices  whose label range includes the label
146                      of the zonename, and  of  the  allocated  devices,  only
147                      those  that  are  allocated at the same label as that of
148                      zonename.
149
150                      When specified with the -n option, lists only those non-
151                      allocated  devices  whose label range includes the label
152                      of the zonename.
153
154                      When specified with the  -u  option,  lists  only  those
155                      devices  that are allocated at the same label as that of
156                      zonename.
157
158

EXAMPLES

160       Example 1 Listing All Devices
161
162
163       The following example lists all devices available  to  the  caller  for
164       allocation:
165
166
167         % list_devices -l
168         device: audio type: audio \
169         files: /dev/audio /dev/audioctl /dev/sound/0 /dev/sound/0ctl
170
171
172
173       Example 2 Listing Attributes of All Devices
174
175
176       On  a  system configured with Trusted Extensions, the following example
177       lists attributes of all devices available to the caller for allocation:
178
179
180         % list_devices -al
181         device=audio1;type=audio;\
182         auths=solaris.device.allocate;\
183         clean=/etc/security/lib/audio_clean;\
184         minlabel=admin_low:maxlabel=admin_high;\
185         files=/dev/audio1 /dev/audio1ctl /dev/sound/1 /dev/sound/1ctl
186
187
188
189       Example 3 Listing Attributes Including the Device Owner
190
191
192       On a system configured with Trusted Extensions, the  following  example
193       lists attributes including the device owner of all devices allocated to
194       the user:
195
196
197         % list_devices -auw
198         device=audio2;type=audio;auths=solaris.device.allocate;\
199         clean=/etc/security/lib/audio_clean;\
200         minlabel=admin_low:maxlabel=admin_high:zone=public;\
201         owner=1234;\
202         files=/dev/audio2 /dev/audio2ctl /dev/sound/2 /dev/sound/2ctl
203
204
205

EXIT STATUS

207       The following exit values are returned:
208
209       0              Successful completion.
210
211
212       20             No entry for the specified device.
213
214
215       other value    An error occurred.
216
217

FILES

219       /etc/security/device_allocate
220
221
222       /etc/security/device_maps
223
224
225       /etc/security/dev/*
226
227
228       /usr/security/lib/*
229

ATTRIBUTES

231       See attributes(5) for descriptions of the following attributes:
232
233
234
235
236       ┌─────────────────────────────┬─────────────────────────────┐
237       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
238       ├─────────────────────────────┼─────────────────────────────┤
239       │Availability                 │SUNWcsu                      │
240       ├─────────────────────────────┼─────────────────────────────┤
241       │Interface Stability          │See below.                   │
242       └─────────────────────────────┴─────────────────────────────┘
243
244
245       The invocation is Uncommitted. The options are Uncommitted. The  output
246       from  the -a and -w options is Uncommitted. All other output is Not-an-
247       Interface.
248

SEE ALSO

250       allocate(1), deallocate(1),  bsmconv(1M),  dminfo(1M),  mkdevalloc(1M),
251       mkdevmaps(1M), device_allocate(4), device_maps(4), attributes(5)
252
253
254       Controlling Access to Devices
255

NOTES

257       The  functionality  described  in  this  man  page is available only if
258       Solaris Auditing has been enabled. See bsmconv(1M)  for  more  informa‐
259       tion.
260
261
262       On  systems  configured  with  Trusted Extensions, the functionality is
263       enabled by default.
264
265
266       /etc/security/dev, mkdevalloc(1M), and mkdevmaps(1M) might not be  sup‐
267       ported in a future release of the Solaris Operating Environment.
268
269
270
271SunOS 5.11                        30 Apr 2008                  list_devices(1)
Impressum