Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
System Functions (k - m) lchown(2)
The _POSIX_CHOWN_RESTRICTED feature is enforced for all files in the OSS file system.
Only processes with appropriate privileges can change owner IDs.
If the owner or group parameter is specified as -1 cast to the type of uid_t or gid_t, respectively,
the corresponding ID of the file is unchanged. To change only one attribute, specify the other as
-1.
Upon successful completion, the lchown() function marks the st_ctime field of the file for
update.
Access Control Lists (ACLs)
A user can allow or deny specific individuals and groups access to a file by using an ACL on the
file. When using the lchown() function with ACLs, if the new owner and/or group of a file have
optional ACL entries corresponding to user:uid:perm or group:gid:perm in the ACL for a file,
those entries remain in the ACL but no longer have any effect because they are superseded by the
user::perm or group::perm entries in the ACL.
ACLs are not supported for symbolic links.
For more information about ACLs, see the acl(5) reference page.
Accessing Files in Restricted-Access Filesets
When accessing a file in a restricted-access fileset, the super ID (255,255 in the Guardian
environment, 65535 in the OSS environment) is restricted. In a restricted-access fileset:
• The super ID (255,255 in the Guardian environment, 65535 in the OSS environment) is
not permitted to invoke this function on files that it does not own unless the executable
file started by the super ID has the PRIVSETID file privilege. In this case, the process
started by the super ID can switch to another ID and then access files in restricted-access
filesets as that ID.
• Processes that are started by a member of the Safeguard SECURITY-OSS-
ADMINISTRATOR (SOA) group have the appropriate privilege to use this function on
any file in a restricted-access fileset. However, if the executable file for the process does
not have the PRIVSOARFOPEN file privilege, the set-user-ID and set-group-ID bits of
the file mode (04000 and 02000 respectively) of the file accessed by this function are
cleared.
• Network File System (NFS) clients are not granted SOA group privileges, even if these
clients are accessing the system with a user ID that is a member of the SOA security
group.
For more information about restricted-access filesets and file privileges, see the Open System Ser-
vices Management and Operations Guide.
Use on Guardian Objects
You can use lchown() function on Guardian disk files (that is, disk files in the /G file system).
Attempts to change the ownership of other types of Guardian files fail and set errno to [EIN-
VAL].
For Guardian disk files, Guardian security is used, and any user can pass file ownership to any
other user. You must specify value other than -1 for the owner parameter (that is, an owner ID
must be specified). However, changing the owner ID also changes the group ID to the Guardian
group ID of the new owner (that is, bits <16:23> of the new access ID). You cannot use the
lchown() function to set the group ID for a Guardian file except as a result of changing the owner
ID.
The _POSIX_CHOWN_RESTRICTED feature is ignored for files in the Guardian file system
(that is, for files in /G).
527186-023 Hewlett-Packard Company 4−11