From 5dd3a0cc17582388e59f8775d5ffdad679b05aa6 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 22 Jun 2021 09:48:42 +0200 Subject: [PATCH] s4:rpc_server: Check return code of cli_credentials_set_conf() Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- source4/rpc_server/remote/dcesrv_remote.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c index 7a362d6b3af..a57f2a75f3e 100644 --- a/source4/rpc_server/remote/dcesrv_remote.c +++ b/source4/rpc_server/remote/dcesrv_remote.c @@ -120,13 +120,21 @@ static NTSTATUS remote_get_private(struct dcesrv_call_state *dce_call, credentials = dcesrv_call_credentials(dce_call); if (user && pass) { + bool ok; + DEBUG(5, ("dcerpc_remote: RPC Proxy: Using specified account\n")); credentials = cli_credentials_init(priv); if (!credentials) { return NT_STATUS_NO_MEMORY; } must_free_credentials = true; - cli_credentials_set_conf(credentials, dce_call->conn->dce_ctx->lp_ctx); + + ok = cli_credentials_set_conf(credentials, + dce_call->conn->dce_ctx->lp_ctx); + if (!ok) { + return NT_STATUS_INTERNAL_ERROR; + } + cli_credentials_set_username(credentials, user, CRED_SPECIFIED); if (domain) { cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED); -- 2.11.4.GIT