summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2021-06-22 09:44:44 +0200
committerAndrew Bartlett <abartlet@samba.org>2021-06-29 02:19:35 +0000
commit9c84bea515ea77c692e52ce81e04bc4df380956b (patch)
tree45f734bab7c1785e6ffc5421bcf8aaf488d09797
parent6fb3cd8d133e1f89be90e62a411f8682049c6129 (diff)
downloadsamba-9c84bea515ea77c692e52ce81e04bc4df380956b.tar.gz
s4:dns:bind_dlz: Check return codes of cli_credentials functions
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source4/dns_server/dlz_bind9.c22
1 files changed, 20 insertions, 2 deletions
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",