s3-libnet_join: always check config correctness while joining offline
authorGünther Deschner <gd@samba.org>
Fri, 19 Feb 2021 14:00:24 +0000 (15:00 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 14 Jul 2021 16:49:30 +0000 (16:49 +0000)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source3/libnet/libnet_join.c

index 48d2a2db046f792461b68efd5731c85121d8242e..263420a2159a08944cce3f6aacda8b97483af088 100644 (file)
@@ -2763,11 +2763,12 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
                return ntstatus_to_werror(status);
        }
 
-       if (!r->in.provision_computer_account_only) {
-               werr = libnet_join_check_config(mem_ctx, r);
-               if (!W_ERROR_IS_OK(werr)) {
+       werr = libnet_join_check_config(mem_ctx, r);
+       if (!W_ERROR_IS_OK(werr)) {
+               if (!r->in.provision_computer_account_only) {
                        goto done;
                }
+               /* do not fail when only provisioning */
        }
 
 #ifdef HAVE_ADS
@@ -2914,6 +2915,11 @@ static WERROR libnet_DomainOfflineJoin(TALLOC_CTX *mem_ctx,
                return ntstatus_to_werror(status);
        }
 
+       werr = libnet_join_check_config(mem_ctx, r);
+       if (!W_ERROR_IS_OK(werr)) {
+               return werr;
+       }
+
        return WERR_OK;
 #if 0
        /* the following fields are currently not filled in */