diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-07-12 14:26:34 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-07-14 16:22:49 +1000 |
commit | 0d95cee58f80e46636fa4b826d248c9ce9983c9b (patch) | |
tree | 8d48702186666fc8a27cb21685c61870fa95d4c5 /source3/auth | |
parent | 1debe30689e75023fab44028ef6942a692e37e95 (diff) | |
download | samba-0d95cee58f80e46636fa4b826d248c9ce9983c9b.tar.gz samba-0d95cee58f80e46636fa4b826d248c9ce9983c9b.tar.bz2 samba-0d95cee58f80e46636fa4b826d248c9ce9983c9b.zip |
s3:auth Change auth_ntlmssp_server_info API to return NTSTATUS
This fixes a bug where register_existing_vuid() could be called with a
NULL server_info if the alloction failed.
Andrew Bartlett
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source3/auth')
-rw-r--r-- | source3/auth/auth_ntlmssp.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index df4666aaee..ba7efbf48e 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -84,8 +84,9 @@ void auth_ntlmssp_want_seal(struct auth_ntlmssp_state *auth_ntlmssp_state) } -struct auth_serversupplied_info *auth_ntlmssp_server_info(TALLOC_CTX *mem_ctx, - struct auth_ntlmssp_state *auth_ntlmssp_state) +NTSTATUS auth_ntlmssp_server_info(TALLOC_CTX *mem_ctx, + struct auth_ntlmssp_state *auth_ntlmssp_state, + struct auth_serversupplied_info **_server_info) { struct auth_serversupplied_info *server_info = auth_ntlmssp_state->server_info; data_blob_free(&server_info->user_session_key); @@ -95,10 +96,12 @@ struct auth_serversupplied_info *auth_ntlmssp_server_info(TALLOC_CTX *mem_ctx, auth_ntlmssp_state->ntlmssp_state->session_key.data, auth_ntlmssp_state->ntlmssp_state->session_key.length); if (auth_ntlmssp_state->ntlmssp_state->session_key.length && !server_info->user_session_key.data) { - return NULL; + *_server_info = NULL; + return NT_STATUS_NO_MEMORY; } auth_ntlmssp_state->server_info = NULL; - return talloc_steal(mem_ctx, server_info); + *_server_info = talloc_steal(mem_ctx, server_info); + return NT_STATUS_OK; } struct ntlmssp_state *auth_ntlmssp_get_ntlmssp_state(struct auth_ntlmssp_state *auth_ntlmssp_state) |