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

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
c
cpacl(3C) cpacl(3C)
RETURN VALUE
If successful, cpacl() and fcpacl() return zero. If an error occurs, they set errno to indicate the
cause of failure and return a negative value, as follows:
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 files 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), setacl(2), stat(2). acltostr(3C), chownacl(3C), strtoacl(3C),
acl(5), aclv(5).
HP-UX Release 11i: December 2000 2 Section 389
___
___