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

System Functions (k - m) lchmod(2)
NAME
lchmod - Changes le-access permissions
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 <sys/stat.h>
int lchmod(
const char *path,
mode_t mode);
PARAMETERS
path Species the full pathname of the le. If the nal component of the path param-
eter refers to a symbolic link, the lchmod() function changes access permissions
for the symbolic link instead of the le to which it refers.
mode Species the bit pattern that determines the access permissions.
DESCRIPTION
The lchmod() function sets the access permissions of a le specied by the path parameter
according to the bit pattern specied by the mode parameter. The lchmod() function is similar to
the chmod() function except when the nal component specied by the path parameter is a sym-
bolic link. If the nal component of the path parameter refers to a symbolic link, the lchmod()
function changes access permissions for the symbolic link instead of the le to which it refers.
Access control lists (ACLs) are not supported for symbolic links. |
To change the le access permissions of a le or directory, the effective user ID of the process |
must match the super ID or the owner of the le, or its effective user ID or one of its group |
afliations must qualify it for membership in the Safeguard SECURITY-OSS- |
ADMINISTRATOR group. |
If lchmod() is invoked by a process whose effective user ID does not equal the super ID or le |
owner, the set-user-ID and set-group-ID bits of the le mode (04000 and 02000, respectively) are |
cleared.
If the S_ISVTX bit is on for a directory, only processes with an effective user ID equal to the
user ID of the les owner or the directorys owner, or a process with appropriate privileges, can
remove les from the directory.
A call to the lchmod() function has no effect on the le descriptor for a le that is open at the
time of the call. However, new openers of the le will be authorized by using the new access per-
missions that were specied in the call.
The mode parameter is constructed by logically ORing one or more of these symbols, which are
dened in the sys/stat.h header le:
S_ISUID Sets the processs effective user ID to the user ID of the les owner on execu-
tion.
527186-007 Hewlett-Packard Company 45