From 9f18298beee5c6abf2cffc9e1d36da2795f4e9d6 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 9 Mar 2006 15:51:55 +0000 Subject: r14075: * add support for long variable names in smb.conf in the form of %(....) * add support for %(DomainSID) * replace standard_sub_XXX() functions with wrappers around their alloc_sub_XXX() counterparts * add support for using SIDs in read list, et. al. (anything that is checked by nt_token_contains_name_in_list()) (This used to be commit 71d960250d2c6d01096a03e98884d3f9c395baa0) --- source3/smbd/share_access.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source3/smbd/share_access.c') diff --git a/source3/smbd/share_access.c b/source3/smbd/share_access.c index a429937f8d..df5f445587 100644 --- a/source3/smbd/share_access.c +++ b/source3/smbd/share_access.c @@ -85,6 +85,13 @@ static BOOL token_contains_name(TALLOC_CTX *mem_ctx, * result that might be interpreted in a wrong way. */ smb_panic("substitutions failed\n"); } + + /* check to see is we already have a SID */ + + if ( string_to_sid( &sid, name ) ) { + DEBUG(5,("token_contains_name: Checking for SID [%s] in token\n", name)); + return nt_token_check_sid( &sid, token ); + } if (!do_group_checks(&name, &prefix)) { if (!lookup_name(mem_ctx, name, LOOKUP_NAME_ALL, @@ -153,14 +160,12 @@ BOOL token_contains_name_in_list(const char *username, return False; } - mem_ctx = talloc_new(NULL); - if (mem_ctx == NULL) { + if ( (mem_ctx = talloc_new(NULL)) == NULL ) { smb_panic("talloc_new failed\n"); } while (*list != NULL) { - if (token_contains_name(mem_ctx, username, sharename, - token, *list)) { + if (token_contains_name(mem_ctx, username, sharename,token, *list)) { TALLOC_FREE(mem_ctx); return True; } -- cgit