From 956aca52025ecc093a618446d84f9649291f33e4 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 29 Aug 2006 16:02:51 +0000 Subject: r17913: saturn fixes from SAMBA_3_0_23 --- source/auth/auth_util.c | 17 ++++++++++------- source/smbd/lanman.c | 8 ++------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/source/auth/auth_util.c b/source/auth/auth_util.c index d12e49d1bc0..507b3c725be 100644 --- a/source/auth/auth_util.c +++ b/source/auth/auth_util.c @@ -1927,17 +1927,20 @@ NT_USER_TOKEN *dup_nt_token(TALLOC_CTX *mem_ctx, NT_USER_TOKEN *ptoken) return NULL; } - token->user_sids = talloc_memdup(token, ptoken->user_sids, + ZERO_STRUCTP(token); + + if (ptoken->user_sids && ptoken->num_sids) { + token->user_sids = talloc_memdup(token, ptoken->user_sids, sizeof(DOM_SID) * ptoken->num_sids ); - if ((ptoken->user_sids != NULL) && (token->user_sids == NULL)) { - DEBUG(0, ("talloc_memdup failed\n")); - TALLOC_FREE(token); - return NULL; + if (token->user_sids == NULL) { + DEBUG(0, ("talloc_memdup failed\n")); + TALLOC_FREE(token); + return NULL; + } + token->num_sids = ptoken->num_sids; } - token->num_sids = ptoken->num_sids; - /* copy the privileges; don't consider failure to be critical here */ if ( !se_priv_copy( &token->privileges, &ptoken->privileges ) ) { diff --git a/source/smbd/lanman.c b/source/smbd/lanman.c index e4531d8ae98..d94572bc767 100644 --- a/source/smbd/lanman.c +++ b/source/smbd/lanman.c @@ -1183,12 +1183,8 @@ static int fill_srv_info(struct srv_info_struct *service, break; } - if (buflen) { - *buflen = struct_len; - } - if (stringspace) { - *stringspace = len; - } + *buflen = struct_len; + *stringspace = len; return struct_len + len; } -- cgit