s3-libnet_join: add new provision_computer_account_only flag
authorGünther Deschner <gd@samba.org>
Fri, 5 Feb 2021 12:23:50 +0000 (13:23 +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
source3/librpc/idl/libnet_join.idl

index fb28fa44dfe3a79e774b70e73ec241b5bf2a2548..da926d26b8c301ac0cdbf48e7b90991037ab6a3f 100644 (file)
@@ -2371,6 +2371,13 @@ static WERROR libnet_join_post_processing(TALLOC_CTX *mem_ctx,
        }
 #endif /* HAVE_ADS */
 
+       if (r->in.provision_computer_account_only) {
+               /*
+                * When we only provision a computer account we are done here - gd.
+                */
+               return WERR_OK;
+       }
+
        saf_join_store(r->out.netbios_domain_name, r->in.dc_name);
        if (r->out.dns_domain_name) {
                saf_join_store(r->out.dns_domain_name, r->in.dc_name);
@@ -2701,9 +2708,11 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
                return ntstatus_to_werror(status);
        }
 
-       werr = libnet_join_check_config(mem_ctx, r);
-       if (!W_ERROR_IS_OK(werr)) {
-               goto done;
+       if (!r->in.provision_computer_account_only) {
+               werr = libnet_join_check_config(mem_ctx, r);
+               if (!W_ERROR_IS_OK(werr)) {
+                       goto done;
+               }
        }
 
 #ifdef HAVE_ADS
@@ -2846,6 +2855,13 @@ WERROR libnet_Join(TALLOC_CTX *mem_ctx,
                goto done;
        }
 
+       if (r->in.provision_computer_account_only) {
+               /*
+                * When we only provision a computer account we are done here - gd.
+                */
+               goto done;
+       }
+
        if (r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_TYPE) {
                werr = libnet_join_post_verify(mem_ctx, r);
                if (!W_ERROR_IS_OK(werr)) {
index 03d919863b5b8261c37ff8ddf3deae1080b4b47e..7c4fff2abf4d0bdf5deb3ad765fcb037e00f4404 100644 (file)
@@ -45,6 +45,7 @@ interface libnetjoin
                [in] netr_SchannelType secure_channel_type,
                [in,noprint] messaging_context *msg_ctx,
                [in] uint32 desired_encryption_types,
+               [in] boolean8 provision_computer_account_only,
                [out] string account_name,
                [out] string netbios_domain_name,
                [out] string dns_domain_name,