diff options
author | Wilco Baan Hofman <wilco@baanhofman.nl> | 2009-03-01 18:44:58 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-04-20 23:16:16 +0200 |
commit | 68ff179b2960c80c56978869e2dd97806b10a214 (patch) | |
tree | a35fce8e907fc61f9bdb3f668c6111fd20b8a956 /source4/libgpo/ads_convenience.c | |
parent | ff33d50fabd6d5262d1917678d83c7c01351f04d (diff) | |
download | samba-68ff179b2960c80c56978869e2dd97806b10a214.tar.gz samba-68ff179b2960c80c56978869e2dd97806b10a214.tar.bz2 samba-68ff179b2960c80c56978869e2dd97806b10a214.zip |
Add nt_token_check_sid convenience function. Map NT_USER_TOKEN to struct security_token. Fix build errors.
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source4/libgpo/ads_convenience.c')
-rw-r--r-- | source4/libgpo/ads_convenience.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/libgpo/ads_convenience.c b/source4/libgpo/ads_convenience.c index e168cb5e0e..77c4f5bdc2 100644 --- a/source4/libgpo/ads_convenience.c +++ b/source4/libgpo/ads_convenience.c @@ -235,6 +235,31 @@ ADS_STATUS ads_build_nt_error(NTSTATUS nt_status) return ret; } + +bool nt_token_check_sid( const struct dom_sid *sid, const NT_USER_TOKEN *token) +{ + int i; + + if (!sid || !token) { + return false; + } + + if (dom_sid_equal(sid, token->user_sid)) { + return true; + } + if (dom_sid_equal(sid, token->group_sid)) { + return true; + } + for (i = 0; i < token->num_sids; i++) { + if (dom_sid_equal(sid, token->sids[i])) { + return true; + } + } + + return false; +} + + /* FIXME Stub write functions, these do not do anything, though they should. -- Wilco |