s4:rpc_server: make use of dcesrv_auth_complete() in dcesrv_auth_alter_ack()
authorStefan Metzmacher <metze@samba.org>
Mon, 15 May 2017 07:14:21 +0000 (09:14 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 21 May 2017 19:05:12 +0000 (21:05 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/rpc_server/dcesrv_auth.c

index 3fda2aad98b9984f08321b3ffd4bb9ed58ae7ba4..3eeba2b90decd29a9f667609807fc88d80c79b0c 100644 (file)
@@ -501,27 +501,7 @@ NTSTATUS dcesrv_auth_alter_ack(struct dcesrv_call_state *call, struct ncacn_pack
                               call->in_auth_info.credentials,
                               &call->out_auth_info->credentials);
 
-       if (NT_STATUS_IS_OK(status)) {
-               status = gensec_session_info(dce_conn->auth_state.gensec_security,
-                                            dce_conn,
-                                            &dce_conn->auth_state.session_info);
-               if (!NT_STATUS_IS_OK(status)) {
-                       DEBUG(1, ("Failed to establish session_info: %s\n", nt_errstr(status)));
-                       return status;
-               }
-               dce_conn->auth_state.auth_finished = true;
-               dce_conn->allow_request = true;
-
-               /* Now that we are authenticated, got back to the generic session key... */
-               dce_conn->auth_state.session_key = dcesrv_generic_session_key;
-               return NT_STATUS_OK;
-       } else if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
-               return NT_STATUS_OK;
-       }
-
-       DEBUG(4, ("GENSEC mech rejected the incoming authentication at auth alter_ack: %s\n",
-                 nt_errstr(status)));
-       return status;
+       return dcesrv_auth_complete(call, status);
 }
 
 /*