diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-01-05 20:11:29 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-01-29 11:16:35 +0100 |
commit | 1c76df6219a4859bc0b7be1e57c1844df78237e7 (patch) | |
tree | 0f509bec4ba96b8710c943e416965c92e793a124 | |
parent | ddd595e687aa24f78de71ba0f0ea74354f95e3d1 (diff) | |
download | samba-1c76df6219a4859bc0b7be1e57c1844df78237e7.tar.gz samba-1c76df6219a4859bc0b7be1e57c1844df78237e7.tar.bz2 samba-1c76df6219a4859bc0b7be1e57c1844df78237e7.zip |
s4:auth_sam: avoid usage of data_blob_talloc_reference() and copy the session keys
metze
-rw-r--r-- | source4/auth/sam.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source4/auth/sam.c b/source4/auth/sam.c index 53de4140c2..4c0fafeff8 100644 --- a/source4/auth/sam.c +++ b/source4/auth/sam.c @@ -503,10 +503,20 @@ _PUBLIC_ NTSTATUS authsam_make_server_info(TALLOC_CTX *mem_ctx, server_info->acct_flags = samdb_result_acct_flags(sam_ctx, mem_ctx, msg, domain_dn); - server_info->user_session_key = data_blob_talloc_reference(server_info, - &user_sess_key); - server_info->lm_session_key = data_blob_talloc_reference(server_info, - &lm_sess_key); + server_info->user_session_key = data_blob_talloc(server_info, + user_sess_key.data, + user_sess_key.length); + if (user_sess_key.data) { + NT_STATUS_HAVE_NO_MEMORY_AND_FREE(server_info->user_session_key.data, + server_info); + } + server_info->lm_session_key = data_blob_talloc(server_info, + lm_sess_key.data, + lm_sess_key.length); + if (lm_sess_key.data) { + NT_STATUS_HAVE_NO_MEMORY_AND_FREE(server_info->lm_session_key.data, + server_info); + } server_info->authenticated = true; |