Changeset 740 for vendor/current/libcli/security/secacl.c
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/libcli/security/secacl.c
r414 r740 24 24 #include "librpc/gen_ndr/ndr_security.h" 25 25 #include "libcli/security/secace.h" 26 #include "libcli/security/secacl.h" 26 27 27 28 #define SEC_ACL_HEADER_SIZE (2 * sizeof(uint16_t) + sizeof(uint32_t)) … … 76 77 return make_sec_acl(ctx, src->revision, src->num_aces, src->aces); 77 78 } 78 79 /*******************************************************************80 Compares two SEC_ACL structures81 ********************************************************************/82 83 bool sec_acl_equal(struct security_acl *s1, struct security_acl *s2)84 {85 unsigned int i, j;86 87 /* Trivial cases */88 89 if (!s1 && !s2) return true;90 if (!s1 || !s2) return false;91 92 /* Check top level stuff */93 94 if (s1->revision != s2->revision) {95 DEBUG(10, ("sec_acl_equal(): revision differs (%d != %d)\n",96 s1->revision, s2->revision));97 return false;98 }99 100 if (s1->num_aces != s2->num_aces) {101 DEBUG(10, ("sec_acl_equal(): num_aces differs (%d != %d)\n",102 s1->revision, s2->revision));103 return false;104 }105 106 /* The ACEs could be in any order so check each ACE in s1 against107 each ACE in s2. */108 109 for (i = 0; i < s1->num_aces; i++) {110 bool found = false;111 112 for (j = 0; j < s2->num_aces; j++) {113 if (sec_ace_equal(&s1->aces[i], &s2->aces[j])) {114 found = true;115 break;116 }117 }118 119 if (!found) return false;120 }121 122 return true;123 }
Note:
See TracChangeset
for help on using the changeset viewer.