]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:rpc_server: Use cli_credentials_init_server()
authorAndreas Schneider <asn@samba.org>
Fri, 4 Sep 2020 10:21:36 +0000 (12:21 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 7 Sep 2020 12:02:15 +0000 (12:02 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
source4/rpc_server/dcerpc_server.c

index 084857a44bf165ab51a0271d61ce12edcf72f982..e64148ef78837db42d61b3b93a3a4f5e0d54881e 100644 (file)
@@ -673,25 +673,14 @@ NTSTATUS dcesrv_gensec_prepare(TALLOC_CTX *mem_ctx,
        struct cli_credentials *server_creds = NULL;
        struct imessaging_context *imsg_ctx =
                dcesrv_imessaging_context(call->conn);
-       NTSTATUS status;
 
-       server_creds = cli_credentials_init(call->auth_state);
-       if (!server_creds) {
+       server_creds = cli_credentials_init_server(call->auth_state,
+                                                  call->conn->dce_ctx->lp_ctx);
+       if (server_creds == NULL) {
                DEBUG(1, ("Failed to init server credentials\n"));
                return NT_STATUS_NO_MEMORY;
        }
 
-       cli_credentials_set_conf(server_creds, call->conn->dce_ctx->lp_ctx);
-
-       status = cli_credentials_set_machine_account(server_creds,
-                                               call->conn->dce_ctx->lp_ctx);
-       if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(1, ("Failed to obtain server credentials: %s\n",
-                         nt_errstr(status)));
-               talloc_free(server_creds);
-               return status;
-       }
-
        return samba_server_gensec_start(mem_ctx,
                                         call->event_ctx,
                                         imsg_ctx,