Open System Services System Calls Reference Manual (G06.28+, H06.05+)
chown(2) OSS System Calls Reference Manual
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 chown() 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.
Use on Guardian Objects
The chown() function can be used 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. A value other than -1 must be specified 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). The chown() function
cannot be used 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).
Use From the Guardian Environment
The chown() function is one of a set of functions that have these effects when the first of them is
called from the Guardian environment:
• Two Guardian file system file numbers (not necessarily the next two available) are allo-
cated for the root directory and the current working directory. These file numbers cannot
be closed by calling the Guardian FILE_CLOSE_ procedure.
• The current working directory is assigned from the VOLUME attribute of the Guardian
environment =_DEFAULTS DEFINE.
• The use of static memory by the process increases slightly.
These effects occur only when the first of the set of functions is called. The effects are not cumu-
lative.
RETURN VALUES
Upon successful completion, the chown() function returns the value 0 (zero). Otherwise, the
value -1 is returned, the owner and group of the file remain unchanged, and errno is set to indi-
cate the error.
ERRORS
If any of these conditions occur, the chown() function sets errno to the corresponding value:
[EACCES] Search permission is denied on a component of the path parameter.
[EFAULT] The path parameter is an invalid address.
[EFSBAD] The fileset catalog for one of the filesets involved in the operation is corrupt.
1−26 Hewlett-Packard Company 527186-007