From: Andreas Schneider Date: Tue, 22 Jun 2021 07:44:44 +0000 (+0200) Subject: s4:dns:bind_dlz: Check return codes of cli_credentials functions X-Git-Tag: tevent-0.11.0~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c84bea515ea77c692e52ce81e04bc4df380956b;p=thirdparty%2Fsamba.git s4:dns:bind_dlz: Check return codes of cli_credentials functions Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c index a9946041206..6f8a1f03de8 100644 --- a/source4/dns_server/dlz_bind9.c +++ b/source4/dns_server/dlz_bind9.c @@ -1588,6 +1588,8 @@ _PUBLIC_ isc_boolean_t dlz_ssumatch(const char *signer, const char *name, const const struct gensec_security_ops **backends = NULL; size_t idx = 0; isc_boolean_t result = ISC_FALSE; + NTSTATUS status; + bool ok; /* Remove cached credentials, if any */ if (state->session_info) { @@ -1615,8 +1617,24 @@ _PUBLIC_ isc_boolean_t dlz_ssumatch(const char *signer, const char *name, const goto exit; } - cli_credentials_set_krb5_context(server_credentials, state->smb_krb5_ctx); - cli_credentials_set_conf(server_credentials, state->lp); + status = cli_credentials_set_krb5_context(server_credentials, + state->smb_krb5_ctx); + if (!NT_STATUS_IS_OK(status)) { + state->log(ISC_LOG_ERROR, + "samba_dlz: failed to set krb5 context"); + talloc_free(tmp_ctx); + result = ISC_FALSE; + goto exit; + } + + ok = cli_credentials_set_conf(server_credentials, state->lp); + if (!ok) { + state->log(ISC_LOG_ERROR, + "samba_dlz: failed to load smb.conf"); + talloc_free(tmp_ctx); + result = ISC_FALSE; + goto exit; + } keytab_file = talloc_asprintf(tmp_ctx, "%s/dns.keytab",