summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-07-01 14:01:24 +1000
committerAndrew Tridgell <tridge@samba.org>2009-07-01 15:15:36 +1000
commitb2c3c08b461042de683b0e49dcaa5f9386c72f9e (patch)
tree5bf3b3616e1dc09008efc7d277a07cc994d53466 /source4
parent9faa0745e9598a9096a7c69c30c273b47393e819 (diff)
downloadsamba-b2c3c08b461042de683b0e49dcaa5f9386c72f9e.tar.gz
samba-b2c3c08b461042de683b0e49dcaa5f9386c72f9e.tar.bz2
samba-b2c3c08b461042de683b0e49dcaa5f9386c72f9e.zip
fixed the use of talloc_steal in ntlmssp_server
The previous use of talloc_steal could cause a steal of a pointer that had references. This ensures that doesn't happen
Diffstat (limited to 'source4')
-rw-r--r--source4/auth/ntlmssp/ntlmssp_server.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp_server.c b/source4/auth/ntlmssp/ntlmssp_server.c
index 00d3e56171..28169d9ff4 100644
--- a/source4/auth/ntlmssp/ntlmssp_server.c
+++ b/source4/auth/ntlmssp/ntlmssp_server.c
@@ -458,6 +458,7 @@ static NTSTATUS ntlmssp_server_postauth(struct gensec_security *gensec_security,
} else if (user_session_key && user_session_key->data) {
session_key = *user_session_key;
+ talloc_steal(gensec_ntlmssp_state, session_key.data);
DEBUG(10,("ntlmssp_server_auth: Using unmodified nt session key.\n"));
dump_data_pw("unmodified session key:\n", session_key.data, session_key.length);
@@ -467,6 +468,7 @@ static NTSTATUS ntlmssp_server_postauth(struct gensec_security *gensec_security,
} else if (lm_session_key && lm_session_key->data) {
/* Very weird to have LM key, but no user session key, but anyway.. */
session_key = *lm_session_key;
+ talloc_steal(gensec_ntlmssp_state, session_key.data);
DEBUG(10,("ntlmssp_server_auth: Using unmodified lm session key.\n"));
dump_data_pw("unmodified session key:\n", session_key.data, session_key.length);
@@ -511,9 +513,6 @@ static NTSTATUS ntlmssp_server_postauth(struct gensec_security *gensec_security,
gensec_ntlmssp_state->session_key = session_key;
}
- /* keep the session key around on the new context */
- talloc_steal(gensec_ntlmssp_state, session_key.data);
-
if ((gensec_security->want_features & GENSEC_FEATURE_SIGN)
|| (gensec_security->want_features & GENSEC_FEATURE_SEAL)) {
nt_status = ntlmssp_sign_init(gensec_ntlmssp_state);