--- acl_support.c.orig Mon Nov 3 22:00:16 2003 +++ acl_support.c Tue Sep 20 18:30:19 2005 @@ -138,7 +138,7 @@ { struct acl *acl_int; struct acl_entry *entry; /* current entry */ - uid_t obj_uid=-1, obj_gid=-1, highest_uid=0, highest_gid=0; + uid_t highest_uid=0, highest_gid=0; int stage = ACL_USER_OBJ; int i = 0; int count_user_obj=0, count_user=0, count_group_obj=0, @@ -147,7 +147,7 @@ acl_int = &acl->ats_acl; /* printf("_posix1e_acl_check: checking acl with %d entries\n", - acl->acl_cnt); */ + acl_int->acl_cnt); */ while (i < acl_int->acl_cnt) { entry = &acl_int->acl_entry[i]; @@ -162,7 +162,6 @@ return (EINVAL); stage = ACL_USER; count_user_obj++; - obj_uid = entry->ae_id; break; case ACL_USER: @@ -170,8 +169,6 @@ if (stage > ACL_USER) return (EINVAL); stage = ACL_USER; - if (entry->ae_id == obj_uid) - return (EINVAL); if (count_user && (entry->ae_id <= highest_uid)) return (EINVAL); highest_uid = entry->ae_id; @@ -185,7 +182,6 @@ return (EINVAL); stage = ACL_GROUP; count_group_obj++; - obj_gid = entry->ae_id; break; case ACL_GROUP: @@ -193,8 +189,6 @@ if (stage > ACL_GROUP) return (EINVAL); stage = ACL_GROUP; - if (entry->ae_id == obj_gid) - return (EINVAL); if (count_group && (entry->ae_id <= highest_gid)) return (EINVAL); highest_gid = entry->ae_id; @@ -230,7 +224,10 @@ if (count_group_obj != 1) return (EINVAL); - if (count_mask != 0 && count_mask != 1) + if (count_mask > 1) + return (EINVAL); + + if ((count_user != 0 || count_group != 0) && count_mask == 0) return (EINVAL); if (count_other != 1)