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

acl(5) OSS System Calls Reference Manual
aclEnt[ newCount-1 ].a_perm = READPERM;
printAcl("New ACL entries before aclsort()",aclEnt, newCount);
/* sort all of the ACL entries into proper order for acl( ACL_SET) */
if ((error = aclsort(newCount, CALCCLASS, aclEnt)) !
=0){
printf("aclsort() error = %d\n", error);
free(aclEnt);
return 1;
}
printAcl("New ACL entries after aclsort()", aclEnt, newCount);
/* now set the new ACL on the object */
if ((error = acl(pathname, ACL_SET, newCount, aclEnt)) == -1 ) {
printf("acl(ACL_SET) error= %d, text = %s\n", errno, strerror(errno));
free(aclEnt);
return 1;
}
free( aclEnt );
return 0;
}
WARNINGS
You cannot use ACLs to restrict the access of the super ID.
Of the various le archive utilities (such as ar, Backup and Restore 2, cpio, pax, and tar), only
the Backup and Restore 2 utility can back up and restore any optional ACL entries associated
with an OSS le. For more information, see the ACL restrictions in the reference pages for the
other le archive utilities.
FILES
sys/acl.h Header le that supports the acl( ) function.
sys/aclv.h Header le that includes the sys/acl.h header le for compatibility with HP-UX.
RELATED INFORMATION
Commands: chmod(1), cp(1), nd(1), getacl(1), ln(1), ls(1), mv(1), rm(1), setacl(1), fsck(1).
Functions: access(2), acl(2), chmod(2), chown(2), creat(2), mknod(2), open(2), stat(2),
aclsort(3).
1212 Hewlett-Packard Company 527186-007