'\" te
.\" Copyright (c) 2008, 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 ALLOCATE 1 "Apr 30, 2008"
.SH NAME
allocate \- device allocation
.SH SYNOPSIS
.LP
.nf
\fBallocate\fR [\fB-s\fR] [\fB-w\fR] [\fB-F\fR] [\fB-U\fR \fIuname\fR] [\fB-z\fR \fIzonename\fR] \fIdevice\fR
.fi

.LP
.nf
\fBallocate\fR [\fB-s\fR] [\fB-w\fR] [\fB-F\fR] [\fB-U\fR \fIuname\fR] [\fB-z\fR \fIzonename\fR] \fB-g\fR \fIdev-type\fR
.fi

.SH DESCRIPTION
.sp
.LP
The \fBallocate\fR utility manages the ownership of devices through its
allocation mechanism. It ensures that each device is used by only one qualified
user at a time.
.sp
.LP
The \fIdevice\fR argument specifies the device to be manipulated. To preserve
the integrity of the device's owner, the allocate operation is executed on all
the device special files associated with that device.
.sp
.LP
The default allocate operation allocates the device special files associated
with \fIdevice\fR to the \fBuid\fR of the current process.
.sp
.LP
Only authorized users may allocate a device. The required authorizations are
specified in \fBdevice_allocate\fR(4).
.sp
.LP
When the system is configured with Trusted Extensions, \fBallocate\fR runs the
clean program for the device before it grants access to the caller to that
device. For devices with removable media that have a mountable file system,
\fBallocate\fR mounts the media if the caller chooses.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-F\fR \fIdevice\fR\fR
.ad
.RS 18n
Force allocates either free or pre-allocated devices. This option is often used
with the \fB-U\fR option to allocate/reallocate devices to a specific user.
Only those users that have \fBsolaris.device.revoke\fR authorization are
allowed to use this option.
.RE

.sp
.ne 2
.na
\fB\fB-g\fR \fIdev\(mitype\fR\fR
.ad
.RS 18n
Allocates devices with a device\(mitype matching \fIdev\(mitype\fR. The
\fIdev\(mitype\fR argument specifies the device type to be operated on.
.RE

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

.sp
.ne 2
.na
\fB\fB-U\fR \fIuname\fR\fR
.ad
.RS 18n
Uses the user ID \fIuname\fR instead of the user ID of the current process when
performing the allocate operation. Only a user with the
\fBsolaris.device.revoke\fR authorization is permitted to use this option.
.RE

.sp
.LP
The following options are supported with Trusted Extensions:
.sp
.ne 2
.na
\fB\fB-w\fR\fR
.ad
.RS 15n
Runs the device cleaning program in a windowing environment. If a windowing
version of the program exists, it is used. Otherwise, the standard version is
run in a terminal window.
.RE

.sp
.ne 2
.na
\fB\fB-z\fR \fIzonename\fR\fR
.ad
.RS 15n
Allocates device to the zone specified by \fIzonename\fR.
.RE

.SH OPERANDS
.sp
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIdevice\fR\fR
.ad
.RS 10n
Specifies the name of the device to be allocated.
.RE

.SH EXIT STATUS
.sp
.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
.sp
.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/etc/security/lib/*\fR
.SH ATTRIBUTES
.sp
.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 is
Not-an-Interface.
.SH SEE ALSO
.sp
.LP
\fBdeallocate\fR(1), \fBlist_devices\fR(1), \fBbsmconv\fR(1M),
\fBdminfo\fR(1M), \fBmkdevalloc\fR(1M), \fBmkdevmaps\fR(1M),
\fBdevice_allocate\fR(4), \fBdevice_maps\fR(4), \fBattributes\fR(5)
.sp
.LP
\fIControlling Access to Devices\fR
.SH NOTES
.sp
.LP
The functionality described in this man page is available only if  Solaris
Auditing has been enabled. See \fBbsmconv\fR(1M) for more information.
.sp
.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.