Go to main content

手册页部分 8:系统管理命令

退出打印视图

更新时间: 2022年7月27日 星期三
 
 

allocate (8)

名称

allocate - device allocation

用法概要

allocate [-s] [-w] [-F] [-U uname] [-z zonename] device
allocate [-s] [-w] [-F] [-U uname] [-z zonename] -g dev-type

描述

allocate 实用程序通过其分配机制管理设备的所有权。它确保每个设备一次只被一个合格用户使用。

device 参数指定要操控的设备。为维护设备所有者的完整性,分配操作将针对与该设备关联的所有特殊文件执行。

缺省的分配操作将与 device 关联的设备特殊文件分配给当前进程的 uid

只有经授权的用户才能分配设备。device_allocate(5) 中指定了所需的授权。

如果系统配置有 Trusted Extensions,则 allocate 在向设备的调用者授予访问权限之前会为该设备运行清理程序。For devices with removable media that have a mountable file system, allocate mounts the media if the caller chooses.

选项

支持以下选项:

–F device

强制分配空闲的或预分配的设备。此选项通常与 –U 选项一起使用来为特定用户分配或重新分配设备。Only those users that have solaris.device.revoke authorization are allowed to use this option.

–g dev-type

分配其设备类型与 dev-type 匹配的设备。dev-type 参数指定要操作的设备的类型。

–s

无提示。禁止任何诊断信息的输出。

–U uname

执行分配操作时,使用用户 ID uname 而不是使用当前进程的用户 ID。仅允许具有 solaris.device.revoke 授权的用户使用此选项。

如果配置了 Trusted Extensions,则还支持以下选项:

–w

在窗口环境中运行设备清理程序。如果该程序的窗口版本存在,则会使用窗口版本。否则,将在终端窗口中运行标准版本。

–z zonename

将设备分配到由 zonename 指定的区域中。

操作数

支持下列操作数:

device

指定要分配的设备的名称。

退出状态

将返回以下退出值:

0

成功完成。

20

对于指定的设备没有任何项。

其他值

出现错误。

文件

/etc/security/device_allocate

/etc/security/device_maps

/etc/security/dev/*

/etc/security/lib/*

属性

有关下列属性的说明,请参见 attributes(7)

属性类型
属性值
可用性
system/device-allocation
接口稳定性
请参见下文。

调用为 "Uncommitted"(未确定)。选项为 "Uncommitted"(未确定)。输出为 "Not-an-Interface"(不是接口)。

另请参见

deallocate(8)list_devices(1)device_allocate(5)device_maps(5)attributes(7)device_allocate(8)dminfo(8)mkdevalloc(8)mkdevmaps(8)

Controlling Access to Devices in Securing Systems and Attached Devices in Oracle Solaris 11.4

附注

只有 Solaris 审计功能启用后,本手册页中描述的功能才可用。

只有 device_allocate(8) 服务启用后,本手册页中描述的功能才可用。

在配置有 Trusted Extensions 的系统上,该功能是缺省启用的。

/etc/security/dev, mkdevalloc(8), and mkdevmaps(8) might not be supported in a future release of the Solaris operating system.