diff options
Diffstat (limited to 'source3/lib/netapi/getdc.c')
-rw-r--r-- | source3/lib/netapi/getdc.c | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/source3/lib/netapi/getdc.c b/source3/lib/netapi/getdc.c index 85a0ae52ef..2626eb0af4 100644 --- a/source3/lib/netapi/getdc.c +++ b/source3/lib/netapi/getdc.c @@ -22,21 +22,8 @@ #include "lib/netapi/netapi.h" #include "libnet/libnet.h" -#if 0 -#include "librpc/gen_ndr/cli_netlogon.h" -#endif - -NTSTATUS rpccli_netr_GetDcName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server, - const char *domainname, - const char **dcname); -NTSTATUS rpccli_netr_GetAnyDCName(struct rpc_pipe_client *cli, - TALLOC_CTX *mem_ctx, - const char *logon_server, - const char *domainname, - const char **dcname, - WERROR *werror); +/******************************************************************** +********************************************************************/ static WERROR NetGetDCNameLocal(struct libnetapi_ctx *ctx, const char *server_name, @@ -46,6 +33,9 @@ static WERROR NetGetDCNameLocal(struct libnetapi_ctx *ctx, return WERR_NOT_SUPPORTED; } +/******************************************************************** +********************************************************************/ + static WERROR NetGetDCNameRemote(struct libnetapi_ctx *ctx, const char *server_name, const char *domain_name, @@ -76,17 +66,11 @@ static WERROR NetGetDCNameRemote(struct libnetapi_ctx *ctx, goto done; }; -#if 0 - werr = rpccli_netr_GetDcName(pipe_cli, ctx, - server_name, - domain_name, - (const char **)&buffer); -#else - werr = rpccli_netlogon_getdcname(pipe_cli, ctx, - server_name, - domain_name, - (char **)buffer); -#endif + status = rpccli_netr_GetDcName(pipe_cli, ctx, + server_name, + domain_name, + (const char **)buffer, + &werr); done: if (cli) { cli_shutdown(cli); @@ -95,6 +79,9 @@ static WERROR NetGetDCNameRemote(struct libnetapi_ctx *ctx, return werr; } +/******************************************************************** +********************************************************************/ + static WERROR libnetapi_NetGetDCName(struct libnetapi_ctx *ctx, const char *server_name, const char *domain_name, @@ -113,6 +100,10 @@ static WERROR libnetapi_NetGetDCName(struct libnetapi_ctx *ctx, buffer); } +/**************************************************************** + NetGetDCName +****************************************************************/ + NET_API_STATUS NetGetDCName(const char *server_name, const char *domain_name, uint8_t **buffer) @@ -134,9 +125,12 @@ NET_API_STATUS NetGetDCName(const char *server_name, return W_ERROR_V(werr); } - return 0; + return NET_API_STATUS_SUCCESS; } +/******************************************************************** +********************************************************************/ + static WERROR NetGetAnyDCNameLocal(struct libnetapi_ctx *ctx, const char *server_name, const char *domain_name, @@ -145,6 +139,9 @@ static WERROR NetGetAnyDCNameLocal(struct libnetapi_ctx *ctx, return WERR_NOT_SUPPORTED; } +/******************************************************************** +********************************************************************/ + static WERROR NetGetAnyDCNameRemote(struct libnetapi_ctx *ctx, const char *server_name, const char *domain_name, @@ -175,22 +172,14 @@ static WERROR NetGetAnyDCNameRemote(struct libnetapi_ctx *ctx, goto done; }; -#if 0 status = rpccli_netr_GetAnyDCName(pipe_cli, ctx, server_name, domain_name, - (const char **)&buffer, + (const char **)buffer, &werr); if (!NT_STATUS_IS_OK(status)) { - werr = ntstatus_to_werror(status); goto done; } -#else - werr = rpccli_netlogon_getanydcname(pipe_cli, ctx, - server_name, - domain_name, - (char **)buffer); -#endif done: if (cli) { cli_shutdown(cli); @@ -200,6 +189,9 @@ static WERROR NetGetAnyDCNameRemote(struct libnetapi_ctx *ctx, } +/******************************************************************** +********************************************************************/ + static WERROR libnetapi_NetGetAnyDCName(struct libnetapi_ctx *ctx, const char *server_name, const char *domain_name, @@ -218,6 +210,10 @@ static WERROR libnetapi_NetGetAnyDCName(struct libnetapi_ctx *ctx, buffer); } +/**************************************************************** + NetGetAnyDCName +****************************************************************/ + NET_API_STATUS NetGetAnyDCName(const char *server_name, const char *domain_name, uint8_t **buffer) @@ -239,5 +235,5 @@ NET_API_STATUS NetGetAnyDCName(const char *server_name, return W_ERROR_V(werr); } - return 0; + return NET_API_STATUS_SUCCESS; } |