diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-02-23 07:20:11 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-02-23 07:20:11 +0000 |
commit | 8d070c60fc99e27d7e58f6d45aa64657c462b875 (patch) | |
tree | c9aafc5ec7d162bc6a98607b8303becaaa6ca33e /source3/lib | |
parent | b58b856db5c5c2583a4bbe24ab39726efefb18a6 (diff) | |
download | samba-8d070c60fc99e27d7e58f6d45aa64657c462b875.tar.gz samba-8d070c60fc99e27d7e58f6d45aa64657c462b875.tar.bz2 samba-8d070c60fc99e27d7e58f6d45aa64657c462b875.zip |
- fixed the sort_acl bug, sorting now works right
- don't allow setting of duplicate ACEs
- fixed a ACE delete bug
(This used to be commit 61293979ce2aded58a5ef2a54b3b05d1d278f7cf)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_sid.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index 98d4e77712..e888c1cbcb 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -442,29 +442,40 @@ BOOL sid_linearize(char *outbuf, size_t len, DOM_SID *sid) /***************************************************************** Compare two sids. *****************************************************************/ - -BOOL sid_equal(const DOM_SID *sid1, const DOM_SID *sid2) +int sid_compare(const DOM_SID *sid1, const DOM_SID *sid2) { int i; - if (sid1 == sid2) return True; - if (!sid1 || !sid2) return False; + if (sid1 == sid2) return 0; + if (!sid1) return -1; + if (!sid2) return 1; /* compare most likely different rids, first: i.e start at end */ for (i = sid1->num_auths-1; i >= 0; --i) if (sid1->sub_auths[i] != sid2->sub_auths[i]) - return False; + return sid1->sub_auths[i] - sid2->sub_auths[i]; if (sid1->num_auths != sid2->num_auths) - return False; + return sid1->num_auths - sid2->num_auths; + if (sid1->sid_rev_num != sid2->sid_rev_num) - return False; + return sid1->sid_rev_num - sid2->sid_rev_num; for (i = 0; i < 6; i++) if (sid1->id_auth[i] != sid2->id_auth[i]) - return False; + return sid1->id_auth[i] - sid2->id_auth[i]; - return True; + return 0; +} + + +/***************************************************************** + Compare two sids. +*****************************************************************/ + +BOOL sid_equal(const DOM_SID *sid1, const DOM_SID *sid2) +{ + return sid_compare(sid1, sid2) == 0; } |