]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:auth: Check return code of cli_credentials_set_conf()
authorAndreas Schneider <asn@samba.org>
Tue, 4 May 2021 09:05:27 +0000 (11:05 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 29 Jun 2021 02:19:35 +0000 (02:19 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/auth/auth_generic.c

index ebb1f19bd540e0105370560136453380a0587e26..0e9245fc23dc6e14317fae955c3aefbed80d9872 100644 (file)
@@ -268,6 +268,7 @@ NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx,
                struct cli_credentials *server_credentials;
                const char *dns_name;
                const char *dns_domain;
+               bool ok;
                struct auth4_context *auth4_context = make_auth4_context_s3(tmp_ctx, auth_context);
                if (auth4_context == NULL) {
                        goto nomem;
@@ -346,7 +347,12 @@ NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx,
                        goto nomem;
                }
 
-               cli_credentials_set_conf(server_credentials, lp_ctx);
+               ok = cli_credentials_set_conf(server_credentials, lp_ctx);
+               if (!ok) {
+                       DBG_ERR("Failed to set server credentials defaults "
+                               "from smb.conf.\n");
+                       goto nomem;
+               }
 
                if (lp_security() == SEC_ADS || USE_KERBEROS_KEYTAB) {
                        cli_credentials_set_kerberos_state(server_credentials,