s3:libnetapi: Add NetComposeOfflineDomainJoin() boilerplate
authorSamuel Cabrero <scabrero@samba.org>
Thu, 31 Aug 2023 10:43:22 +0000 (12:43 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 5 Sep 2023 21:18:32 +0000 (21:18 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13577

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/lib/netapi/joindomain.c
source3/lib/netapi/libnetapi.c
source3/lib/netapi/libnetapi.h

index 31e3ac74b1ee0da6405d56356874e6ef192ad4e6..224571587282dbee958550b1f35ea658eca3298a 100644 (file)
@@ -947,3 +947,21 @@ WERROR NetRequestOfflineDomainJoin_l(struct libnetapi_ctx *ctx,
 
        return W_ERROR(NERR_JoinPerformedMustRestart);
 }
+
+/****************************************************************
+****************************************************************/
+
+WERROR NetComposeOfflineDomainJoin_r(struct libnetapi_ctx *ctx,
+                                    struct NetComposeOfflineDomainJoin *r)
+{
+       return WERR_NOT_SUPPORTED;
+}
+
+/****************************************************************
+****************************************************************/
+
+WERROR NetComposeOfflineDomainJoin_l(struct libnetapi_ctx *ctx,
+                                    struct NetComposeOfflineDomainJoin *r)
+{
+       return WERR_NOT_SUPPORTED;
+}
index 2fd97bba75bed105cb1cfc364919a4e5fd3eec02..29073168ef81f4c3cdcaa6610f46efb533e3846f 100644 (file)
@@ -392,6 +392,73 @@ NET_API_STATUS NetRequestOfflineDomainJoin(uint8_t *provision_bin_data /* [in] [
        return (NET_API_STATUS)r.out.result;
 }
 
+/****************************************************************
+ NetComposeOfflineDomainJoin
+****************************************************************/
+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 **compose_bin_data /* [in,out] [unique] */,
+                                          uint32_t *compose_bin_data_size /* [in,out] [unique] */,
+                                          const char * *compose_text_data /* [in,out] [unique] */)
+{
+       struct NetComposeOfflineDomainJoin r;
+       struct libnetapi_ctx *ctx = NULL;
+       NET_API_STATUS status;
+       WERROR werr;
+       TALLOC_CTX *frame = talloc_stackframe();
+
+       ZERO_STRUCT(r);
+
+       status = libnetapi_getctx(&ctx);
+       if (status != 0) {
+               TALLOC_FREE(frame);
+               return status;
+       }
+
+       /* In parameters */
+       r.in.dns_domain_name = dns_domain_name;
+       r.in.netbios_domain_name = netbios_domain_name;
+       r.in.domain_sid = domain_sid;
+       r.in.domain_guid = domain_guid;
+       r.in.forest_name = forest_name;
+       r.in.machine_account_name = machine_account_name;
+       r.in.machine_account_password = machine_account_password;
+       r.in.dc_name = dc_name;
+       r.in.dc_address = dc_address;
+       r.in.domain_is_ad = domain_is_ad;
+       r.in.compose_bin_data = compose_bin_data;
+       r.in.compose_bin_data_size = compose_bin_data_size;
+       r.in.compose_text_data = compose_text_data;
+
+       /* Out parameters */
+       r.out.compose_bin_data = compose_bin_data;
+       r.out.compose_bin_data_size = compose_bin_data_size;
+       r.out.compose_text_data = compose_text_data;
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_IN_DEBUG(NetComposeOfflineDomainJoin, &r);
+       }
+
+       werr = NetComposeOfflineDomainJoin_l(ctx, &r);
+
+       r.out.result = W_ERROR_V(werr);
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_OUT_DEBUG(NetComposeOfflineDomainJoin, &r);
+       }
+
+       TALLOC_FREE(frame);
+       return (NET_API_STATUS)r.out.result;
+}
+
 /****************************************************************
  NetServerGetInfo
 ****************************************************************/
index d217656845d7ca7b2567191bf2153f72ac1527e1..784d467ff5578402b0d6f3a857e621711d95939a 100644 (file)
@@ -83,6 +83,23 @@ WERROR NetRequestOfflineDomainJoin_r(struct libnetapi_ctx *ctx,
                                     struct NetRequestOfflineDomainJoin *r);
 WERROR NetRequestOfflineDomainJoin_l(struct libnetapi_ctx *ctx,
                                     struct NetRequestOfflineDomainJoin *r);
+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] */);
+WERROR NetComposeOfflineDomainJoin_r(struct libnetapi_ctx *ctx,
+                                    struct NetComposeOfflineDomainJoin *r);
+WERROR NetComposeOfflineDomainJoin_l(struct libnetapi_ctx *ctx,
+                                    struct NetComposeOfflineDomainJoin *r);
 NET_API_STATUS NetServerGetInfo(const char * server_name /* [in] [unique] */,
                                uint32_t level /* [in] */,
                                uint8_t **buffer /* [out] [ref] */);