summaryrefslogtreecommitdiff
path: root/source4/auth/gensec/gensec.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-01-17 16:20:09 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-01-18 10:55:05 +0100
commit9b643c8c83bda42b5f8ad1d9ca0419e1e1c0e372 (patch)
treee9e01697d49793564d67305cc539e3b115079904 /source4/auth/gensec/gensec.c
parentd5173ca189a080d0bb3a56200203c32a40c4b6e3 (diff)
downloadsamba-9b643c8c83bda42b5f8ad1d9ca0419e1e1c0e372.tar.gz
samba-9b643c8c83bda42b5f8ad1d9ca0419e1e1c0e372.tar.bz2
samba-9b643c8c83bda42b5f8ad1d9ca0419e1e1c0e372.zip
s4-gensec Don't steal the auth_context, reference it.
We don't want to steal this pointer away from the caller if it's been set up from python. Andrew Bartlett
Diffstat (limited to 'source4/auth/gensec/gensec.c')
-rw-r--r--source4/auth/gensec/gensec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/auth/gensec/gensec.c b/source4/auth/gensec/gensec.c
index 3c25f3b913..c732c6e8de 100644
--- a/source4/auth/gensec/gensec.c
+++ b/source4/auth/gensec/gensec.c
@@ -507,7 +507,7 @@ const char **gensec_security_oids(struct gensec_security *gensec_security,
@param mem_ctx The parent TALLOC memory context.
@param gensec_security Returned GENSEC context pointer.
@note The mem_ctx is only a parent and may be NULL.
- @note, the auth context is moved to be a child of the
+ @note, the auth context is moved to be a referenced pointer of the
@ gensec_security return
*/
static NTSTATUS gensec_start(TALLOC_CTX *mem_ctx,
@@ -527,7 +527,11 @@ static NTSTATUS gensec_start(TALLOC_CTX *mem_ctx,
(*gensec_security)->event_ctx = ev;
SMB_ASSERT(settings->lp_ctx != NULL);
(*gensec_security)->settings = talloc_reference(*gensec_security, settings);
- (*gensec_security)->auth_context = talloc_steal(*gensec_security, auth_context);
+
+ /* We need to reference this, not steal, as the caller may be
+ * python, which won't like it if we steal it's object away
+ * from it */
+ (*gensec_security)->auth_context = talloc_reference(*gensec_security, auth_context);
return NT_STATUS_OK;
}