diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-12-03 06:04:18 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-12-03 06:04:18 +0000 |
commit | 2285b99cb1047ea85589ef23d4ca73278a15ee08 (patch) | |
tree | 4075ad18c9d81dba881b23b4a8d263b1ab9078fb /source3/lib | |
parent | feb4f52f134d463c9871cd1709897a4b9ccfc6d2 (diff) | |
download | samba-2285b99cb1047ea85589ef23d4ca73278a15ee08.tar.gz samba-2285b99cb1047ea85589ef23d4ca73278a15ee08.tar.bz2 samba-2285b99cb1047ea85589ef23d4ca73278a15ee08.zip |
added a basic ADS backend to winbind. More work needed, but at
least basic operations work
(This used to be commit 88241cab983b2c7db7d477c6c4654694a7a56cd3)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util_sid.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index 06ff9510b7..0f1b22ca27 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -494,7 +494,6 @@ DOM_SID *sid_dup(DOM_SID *src) /***************************************************************** Write a sid out into on-the-wire format. *****************************************************************/ - BOOL sid_linearize(char *outbuf, size_t len, DOM_SID *sid) { size_t i; @@ -512,6 +511,23 @@ BOOL sid_linearize(char *outbuf, size_t len, DOM_SID *sid) } /***************************************************************** + parse a on-the-wire SID to a DOM_SID +*****************************************************************/ +BOOL sid_parse(char *inbuf, size_t len, DOM_SID *sid) +{ + int i; + if (len < 8) return False; + sid->sid_rev_num = CVAL(inbuf, 0); + sid->num_auths = CVAL(inbuf, 1); + memcpy(sid->id_auth, inbuf+2, 6); + if (len < 8 + sid->num_auths*4) return False; + for (i=0;i<sid->num_auths;i++) { + sid->sub_auths[i] = IVAL(inbuf, 8+i*4); + } + return True; +} + +/***************************************************************** Compare two sids. *****************************************************************/ int sid_compare(const DOM_SID *sid1, const DOM_SID *sid2) |