summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-05-21 16:01:34 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-05-21 16:01:34 +1000
commit9453a0f88f1d0c337a3c1b24a2567e2dde3466e8 (patch)
tree5e7115287be5ae88c705a686078cffcaf4fbbf92
parent80b4d50603fb54011396f0d868ffc9907247d2af (diff)
downloadsamba-9453a0f88f1d0c337a3c1b24a2567e2dde3466e8.tar.gz
samba-9453a0f88f1d0c337a3c1b24a2567e2dde3466e8.tar.bz2
samba-9453a0f88f1d0c337a3c1b24a2567e2dde3466e8.zip
s4:auth Fix previous commit - segfault in determinging a user's groups
The previous commit didn't include these vital fixes. Andrew Bartlett
-rw-r--r--source4/auth/sam.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source4/auth/sam.c b/source4/auth/sam.c
index 2cc8118fe1..d6d1a50522 100644
--- a/source4/auth/sam.c
+++ b/source4/auth/sam.c
@@ -27,8 +27,6 @@
#include "../lib/util/util_ldb.h"
#include "dsdb/samdb/samdb.h"
#include "libcli/security/security.h"
-#include "libcli/ldap/ldap.h"
-#include "../libcli/ldap/ldap_ndr.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "param/param.h"
@@ -367,8 +365,9 @@ NTSTATUS authsam_expand_nested_groups(struct ldb_context *sam_ctx,
if (!only_childs) {
*res_sids = talloc_realloc(res_sids_ctx, *res_sids,
struct dom_sid *, *num_res_sids + 1);
- NT_STATUS_HAVE_NO_MEMORY(*res_sids);
- (*res_sids)[*num_res_sids] = talloc_steal(*res_sids, &sid);
+ NT_STATUS_HAVE_NO_MEMORY_AND_FREE(*res_sids, tmp_ctx);
+ (*res_sids)[*num_res_sids] = dom_sid_dup(*res_sids, &sid);
+ NT_STATUS_HAVE_NO_MEMORY_AND_FREE((*res_sids)[*num_res_sids], tmp_ctx);
++(*num_res_sids);
}
@@ -384,7 +383,6 @@ NTSTATUS authsam_expand_nested_groups(struct ldb_context *sam_ctx,
}
}
- talloc_free(res);
talloc_free(tmp_ctx);
return NT_STATUS_OK;