Open System Services System Calls Reference Manual (G06.28+, H06.05+)
System Functions (k - m) lchmod(2)
Access Control Lists (ACLs)
When you execute the lchmod() function, you can change the effective permissions granted by |
optional entries in the ACL for a file. In particular, using the lchmod() function to remove read, |
write, and execute permissions from a file owner, owning group, and all others works as |
expected, because the lchmod() function affects the class entry in the ACL, limiting any access |
that can be granted to additional users or groups through optional ACL entries. To verify the |
effect, use getacl command on the file after the lchmod() function completes and note that all |
optional (nondefault) ACL entries with nonzero permissions also have the comment |
# effective:---. |
To set the permission bits of ACL entries, use the acl() function instead of the lchmod() func- |
tion. |
ACLs are not supported for symbolic links.
Use on Guardian Objects
Attempting to set the access permissions on a Guardian file (that is, a file in the /G file system)
fails with errno set to [EINVAL].
Use From the Guardian Environment
The lchmod() 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 lchmod() function returns the value 0 (zero). Otherwise, the
value -1 is returned, and errno is set to indicate the error.
ERRORS
If any of these conditions occur, the lchmod() function sets errno to the corresponding value:
[EACCES] Search permission is denied for a component of the path parameter.
[EFAULT] The path parameter points to a location outside of the allocated address space of
the process.
[EFSBAD] The fileset catalog for one of the filesets involved in the operation is corrupt.
[EINVAL] One of these conditions exists:
• The value of the mode parameter is invalid.
• An attempt was made to set access permissions on a Guardian file (that
is, a file in the /G file system).
527186-007 Hewlett-Packard Company 4−7