Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

Miscellaneous acl(5)
return 1;
}
printAcl("Existing ACL entries", aclEnt, prevCount);
/* add new GROUP acl entry at the end of the ACL */
aclEnt[ newCount-1 ].a_type = GROUP;
aclEnt[ newCount-1 ].a_id = groupId;
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 file 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 file. For more information, see the ACL restrictions in the reference pages for the
other file archive utilities.
FILES
sys/acl.h Header file that supports the acl() function.
sys/aclv.h Header file that includes the sys/acl.h header file for compatibility with
HP-UX.
RELATED INFORMATION
Commands: chmod(1), cp(1), find(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).
527186-023 Hewlett-Packard Company 1215