diff options
author | Günther Deschner <gd@samba.org> | 2021-02-04 21:41:27 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2021-07-14 16:49:30 +0000 |
commit | 3f71d1fa1c011d04636897852768c209793df4d9 (patch) | |
tree | bb6f70da95b5b72fa22227a42edc1c927f2951c1 /source3 | |
parent | b19a145e8f0d25291a209436ce55b9f8d8a5fd80 (diff) | |
download | samba-3f71d1fa1c011d04636897852768c209793df4d9.tar.gz |
s3-libnetapi: add NetProvisionComputerAccount() boilerplate
Guenther
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/netapi/joindomain.c | 18 | ||||
-rw-r--r-- | source3/lib/netapi/libnetapi.c | 58 | ||||
-rw-r--r-- | source3/lib/netapi/libnetapi.h | 12 |
3 files changed, 88 insertions, 0 deletions
diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c index 90a58824fe5..27cb84d01a9 100644 --- a/source3/lib/netapi/joindomain.c +++ b/source3/lib/netapi/joindomain.c @@ -589,3 +589,21 @@ WERROR NetRenameMachineInDomain_l(struct libnetapi_ctx *ctx, { LIBNETAPI_REDIRECT_TO_LOCALHOST(ctx, r, NetRenameMachineInDomain); } + +/**************************************************************** +****************************************************************/ + +WERROR NetProvisionComputerAccount_r(struct libnetapi_ctx *ctx, + struct NetProvisionComputerAccount *r) +{ + return WERR_NOT_SUPPORTED; +} + +/**************************************************************** +****************************************************************/ + +WERROR NetProvisionComputerAccount_l(struct libnetapi_ctx *ctx, + struct NetProvisionComputerAccount *r) +{ + return WERR_NOT_SUPPORTED; +} diff --git a/source3/lib/netapi/libnetapi.c b/source3/lib/netapi/libnetapi.c index 1fdec7934b7..210366e6278 100644 --- a/source3/lib/netapi/libnetapi.c +++ b/source3/lib/netapi/libnetapi.c @@ -288,6 +288,64 @@ NET_API_STATUS NetRenameMachineInDomain(const char * server_name /* [in] */, } /**************************************************************** + NetProvisionComputerAccount +****************************************************************/ + +NET_API_STATUS NetProvisionComputerAccount(const char * domain /* [in] [ref] */, + const char * machine_name /* [in] [ref] */, + const char * machine_account_ou /* [in] [unique] */, + const char * dcname /* [in] [unique] */, + uint32_t options /* [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] */) +{ + struct NetProvisionComputerAccount 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.domain = domain; + r.in.machine_name = machine_name; + r.in.machine_account_ou = machine_account_ou; + r.in.dcname = dcname; + r.in.options = options; + r.in.provision_bin_data = provision_bin_data; + r.in.provision_bin_data_size = provision_bin_data_size; + r.in.provision_text_data = provision_text_data; + + /* Out parameters */ + r.out.provision_bin_data = provision_bin_data; + r.out.provision_bin_data_size = provision_bin_data_size; + r.out.provision_text_data = provision_text_data; + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_IN_DEBUG(NetProvisionComputerAccount, &r); + } + + werr = NetProvisionComputerAccount_l(ctx, &r); + + r.out.result = W_ERROR_V(werr); + + if (DEBUGLEVEL >= 10) { + NDR_PRINT_OUT_DEBUG(NetProvisionComputerAccount, &r); + } + + TALLOC_FREE(frame); + return (NET_API_STATUS)r.out.result; +} + +/**************************************************************** NetServerGetInfo ****************************************************************/ diff --git a/source3/lib/netapi/libnetapi.h b/source3/lib/netapi/libnetapi.h index 27e4b5d2324..eab9cae3013 100644 --- a/source3/lib/netapi/libnetapi.h +++ b/source3/lib/netapi/libnetapi.h @@ -63,6 +63,18 @@ WERROR NetRenameMachineInDomain_r(struct libnetapi_ctx *ctx, struct NetRenameMachineInDomain *r); WERROR NetRenameMachineInDomain_l(struct libnetapi_ctx *ctx, struct NetRenameMachineInDomain *r); +NET_API_STATUS NetProvisionComputerAccount(const char * domain /* [in] [ref] */, + const char * machine_name /* [in] [ref] */, + const char * machine_account_ou /* [in] [unique] */, + const char * dcname /* [in] [unique] */, + uint32_t options /* [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 NetProvisionComputerAccount_r(struct libnetapi_ctx *ctx, + struct NetProvisionComputerAccount *r); +WERROR NetProvisionComputerAccount_l(struct libnetapi_ctx *ctx, + struct NetProvisionComputerAccount *r); NET_API_STATUS NetServerGetInfo(const char * server_name /* [in] [unique] */, uint32_t level /* [in] */, uint8_t **buffer /* [out] [ref] */); |