summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-08-29 16:02:51 +0000
committerGerald Carter <jerry@samba.org>2006-08-29 16:02:51 +0000
commit956aca52025ecc093a618446d84f9649291f33e4 (patch)
treeab090a3a24df436aa6078ebad28d1224b0cd841a /source
parent43328fbd2ec7062be792f5eca188364a904ec240 (diff)
downloadsamba-956aca52025ecc093a618446d84f9649291f33e4.tar.gz
samba-956aca52025ecc093a618446d84f9649291f33e4.tar.xz
samba-956aca52025ecc093a618446d84f9649291f33e4.zip
r17913: saturn fixes from SAMBA_3_0_23
Diffstat (limited to 'source')
-rw-r--r--source/auth/auth_util.c17
-rw-r--r--source/smbd/lanman.c8
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;
}