From ad2196fd79247dd133cbba3a5bf39721e741699e Mon Sep 17 00:00:00 2001 From: Samuel Cabrero Date: Thu, 31 Aug 2023 12:44:26 +0200 Subject: [PATCH] s3:libnetapi: Add NetComposeOfflineDomainJoin() to API. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13577 Signed-off-by: Samuel Cabrero Reviewed-by: Andrew Bartlett (cherry picked from commit 7cabbec2eaf5aefd3751c635c12556eca590f506) --- source3/lib/netapi/netapi.h | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/source3/lib/netapi/netapi.h b/source3/lib/netapi/netapi.h index df465aef51b..660a7766bd6 100644 --- a/source3/lib/netapi/netapi.h +++ b/source3/lib/netapi/netapi.h @@ -1673,6 +1673,49 @@ NET_API_STATUS NetRequestOfflineDomainJoin(uint8_t *provision_bin_data /* [in] [ uint32_t options /* [in] */, const char * windows_path /* [in] [unique] */); +/************************************************************//** + * + * NetComposeOfflineDomainJoin + * + * @brief Compose an offline domain join blob + * + * Intended to be used by external applications who provision the computer + * acconut on their own. + * + * + * @param[in] dns_domain_name The domain DNS name + * @param[in] netbios_domain_name The domain NETBIOS name + * @param[in] domain_sid The domain SID + * @param[in] domain_guid The domain GUID + * @param[in] forest_name The forest name + * @param[in] machine_account_name The machine account name + * @param[in] machine_account_password The machine account password + * @param[in] dc_name The domain controller name used to provision the account + * @param[in] dc_address The domain controller address used to provision the account + * @param[in] domain_is_ad True if the domain is AD + * @param[in,out] compose_bin_data The generated binary buffer + * @param[in,out] compose_bin_data_size The generated binary buffer size + * @param[in,out] compose_text_data The generated text data blob + * @return NET_API_STATUS + * + * example join/compose_offline_domain_join.c + * + ***************************************************************/ + +NET_API_STATUS NetComposeOfflineDomainJoin(const char *dns_domain_name /* [in] [ref] */, + const char *netbios_domain_name /* [in] [ref] */, + struct domsid *domain_sid /* [in] [ref] */, + struct GUID *domain_guid /* [in] [ref] */, + const char *forest_name /* [in] [ref] */, + const char *machine_account_name /* [in] [ref] */, + const char *machine_account_password /* [in] [ref] */, + const char *dc_name /* [in] [unique] */, + const char *dc_address /* [in] [unique] */, + int domain_is_ad /* [in] */, + uint8_t **provision_bin_data /* [in,out] [unique] */, + uint32_t *provision_bin_data_size /* [in,out] [unique] */, + const char * *provision_text_data /* [in,out] [unique] */); + /************************************************************//** * * NetServerGetInfo -- 2.34.1