From edba46ce94c335411ab337eeb4ef6f88fb3aae80 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 2 Jun 2010 22:35:53 +1000 Subject: s3:auth Change auth_ntlmssp_server_info API to return NTSTATUS It's nicer to have an NTSTATUS return, and in s3compat there may be a reason other than 'no memory' why this can fail. Andrew Bartlett --- source3/auth/auth_ntlmssp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source3/auth') diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index e0e0003f9d..1b48ba022d 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -74,8 +74,9 @@ bool auth_ntlmssp_negotiated_seal(struct auth_ntlmssp_state *auth_ntlmssp_state) return auth_ntlmssp_state->ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_SEAL; } -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); @@ -85,10 +86,11 @@ 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; + 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) -- cgit