diff options
author | Jeremy Allison <jra@samba.org> | 1999-01-12 02:16:34 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1999-01-12 02:16:34 +0000 |
commit | cc7c91e6cb5ccc17885b8e23b8add02a007266d4 (patch) | |
tree | e5aaa3279fe6758446725f1ebc3de75f38469f75 /source/lib | |
parent | 8cf6a8903faa85df60a681327d3ba8a64b5e4cd8 (diff) | |
download | samba-cc7c91e6cb5ccc17885b8e23b8add02a007266d4.tar.gz samba-cc7c91e6cb5ccc17885b8e23b8add02a007266d4.tar.xz samba-cc7c91e6cb5ccc17885b8e23b8add02a007266d4.zip |
Implemented NT_QUERY_SECURITY_DESCRIPTOR in the same way that NT responds
if you send this query to a FAT volume. Phew - I'm glad I got this one in
under the wire for 2.0.0.....
Jeremy.
Diffstat (limited to 'source/lib')
-rw-r--r-- | source/lib/util_sid.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/source/lib/util_sid.c b/source/lib/util_sid.c index 152a046b26a..5af2aedc0cd 100644 --- a/source/lib/util_sid.c +++ b/source/lib/util_sid.c @@ -153,6 +153,27 @@ void sid_copy(DOM_SID *sid1, DOM_SID *sid2) sid1->num_auths = sid2->num_auths; sid1->sid_rev_num = sid2->sid_rev_num; } + +/***************************************************************** + Write a sid out into on-the-wire format. +*****************************************************************/ + +BOOL sid_linearize(char *outbuf, size_t len, DOM_SID *sid) +{ + size_t i; + + if(len < sid_size(sid)) + return False; + + SCVAL(outbuf,0,sid->sid_rev_num); + SCVAL(outbuf,1,sid->num_auths); + memcpy(&outbuf[2], sid->id_auth, 6); + for(i = 0; i < sid->num_auths; i++) + SIVAL(outbuf, 8 + (i*4), sid->sub_auths[i]); + + return True; +} + /***************************************************************** compare two sids *****************************************************************/ @@ -181,7 +202,7 @@ BOOL sid_equal(DOM_SID *sid1, DOM_SID *sid2) /***************************************************************** calculates size of a sid *****************************************************************/ -int sid_size(DOM_SID *sid) +size_t sid_size(DOM_SID *sid) { if (sid == NULL) { |