Open System Services System Calls Reference Manual (G06.28+, H06.05+)

lchown(2) OSS System Calls Reference Manual
NAME
lchown - Changes the owner and group IDs of a le
LIBRARY
G-series native Guardian processes: system library
G-series native OSS processes: system library
H-series native Guardian processes: implicit libraries
H-series OSS processes: implicit libraries
SYNOPSIS
#include <sys/types.h> /* optional except for POSIX.1 */
#include <unistd.h>
int lchown(
const char *path,
uid_t owner,
gid_t group);
PARAMETERS
path Species the name of the le whose owner ID, group ID, or both are to be
changed. If the nal component of the path parameter names a symbolic link,
the lchown function changes the ownership of the symbolic link instead of the
le or directory to which the symbolic link refers.
owner Species a numeric value representing the owner ID.
group Species a numeric value representing the group ID.
DESCRIPTION
The lchown() function changes the owner and group of a le. The lchown() function is
equivalent to the chown() function except when the nal component of the path parameter refers
to a symbolic link. If the nal component of the path parameter names a symbolic link:
The lchown function changes the ownership of the symbolic link instead of the le or
directory to which the symbolic link refers.
Access control lists (ACLs) are not supported for a symbolic link. |
Only a process that has an effective user ID equal to the super ID or to the le owner, or that has |
an effective user ID or group afliation qualifying for membership in the Safeguard |
SECURITY-OSS-ADMINISTRATOR group can use the lchown() function to change the group |
of a le. However, processes that have an effective user ID equal to the le owner can only |
change the group of a le to a group to which they belong (their effective group or one of their |
supplementary groups). |
If the lchown() function is invoked by a process whose effective user ID does not equal the super |
ID, the set-user-ID and set-group-ID bits of the le mode (04000 and 02000, respectively) are |
cleared.
A process can change the value of the owner ID of an OSS le only if the effective user ID of the
process gives the process appropriate privileges. A process can change the value of the le
group ID if the effective user ID of the process matches the owner ID of the le or the process
has appropriate privileges. A process without appropriate privileges can change the group ID of
a le only to the value of its effective group ID or to a value in its group list. However, if the
lchown() function is successfully invoked on a le, the S_ISGID and S_ISUID bits of the
st_mode eld of the stat structure are cleared unless the user has appropriate privileges.
The _POSIX_CHOWN_RESTRICTED feature is enforced for all les in the OSS le system.
Only processes with appropriate privileges can change owner IDs.
410 Hewlett-Packard Company 527186-007