HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)

c
cpacl(3C) cpacl(3C)
1 Unable to perform
acl() or getacl() (fgetacl()) on a local fromfile (fromfd).
2 Unable to perform
chmod() (fchmod())ontofile (tofd) to set its file miscellaneous mode bits.
cpacl() (fcpacl()) attempts this regardless of whether a file is local or remote, as long as
fromfile (fromfd)islocal.
3 Unable to perform
acl() or setacl() (fsetacl()) on a local tofile (tofd). As a consequence,
the file’s optional
ACL entries are deleted (HFS only), its file access permission bits are zeroed, and its
miscellaneous mode bits might be altered.
4 Unable to perform
chmod() (fchmod())ontofile (tofd) to set its mode. As a consequence, if
fromfile (fromfd) is local, tofile’s (tofd’s) optional
ACL entries are deleted (HFS only), its access permis-
sion bits are zeroed, and its file miscellaneous mode bits might be altered, regardless of whether the
file is local or remote.
EXAMPLES
The following code fragment gets stat information on
oldfile and copies its file miscellaneous bits and
access control list to
newfile owned by the caller. If either file is remote, only the
st_mode on old-
file
is copied.
#include <sys/types.h>
#include <sys/stat.h>
struct stat statbuf;
if (stat ("oldfile", & statbuf) < 0)
error (...);
if (cpacl ("oldfile", newfile , statbuf.st_mode,
statbuf.st_uid, statbuf.st_gid, geteuid(), getegid()) < 0)
{
error (...);
}
DEPENDENCIES
cpacl() and fcpacl() are only supported on HFS file system on standard HP-UX operating system.
AUTHOR
cpacl() and fcpacl() were developed by HP.
SEE ALSO
acl(2), chown(2), getacl(2), getegid(2), geteuid(2), getuid(2), setacl(2), stat(2), acltostr(3C), chownacl(3C),
strtoacl(3C), acl(5), aclv(5), thread_safety(5).
Section 390 Hewlett-Packard Company 2 HP-UX 11i Version 1: September 2005