cpacl.3c (2010 09)
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 per-
mission 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 and JFS file systems on standard HP-UX operating
systems.
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).
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010