summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-01-17 10:39:15 +0100
committerGünther Deschner <gd@samba.org>2008-01-17 16:54:46 +0100
commitd1abd4d866b59fa67605fc469d6406a981455fbe (patch)
treefcaf03782706b94beb1e24e908d1afaf46ac6adb /source3
parent10a55fb4ea8cbfec5b58fb00389ff4d48e4e527e (diff)
downloadsamba-d1abd4d866b59fa67605fc469d6406a981455fbe.tar.gz
samba-d1abd4d866b59fa67605fc469d6406a981455fbe.tar.bz2
samba-d1abd4d866b59fa67605fc469d6406a981455fbe.zip
Use new pidl-generated netlogon client calls in NetApi GetDcName().
Guenther (This used to be commit 733e07a06ce3c903ff5837df6a5119f6d6e3eccb)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/netapi/examples/getdc/getdc.c4
-rw-r--r--source3/lib/netapi/getdc.c42
2 files changed, 8 insertions, 38 deletions
diff --git a/source3/lib/netapi/examples/getdc/getdc.c b/source3/lib/netapi/examples/getdc/getdc.c
index cdd4d0b3b4..272ba1088e 100644
--- a/source3/lib/netapi/examples/getdc/getdc.c
+++ b/source3/lib/netapi/examples/getdc/getdc.c
@@ -29,7 +29,7 @@ int main(int argc, char **argv)
{
NET_API_STATUS status;
struct libnetapi_ctx *ctx = NULL;
- uint8_t *buffer;
+ uint8_t *buffer = NULL;
if (argc < 3) {
printf("usage: getdc <hostname> <domain>\n");
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
} else {
printf("%s\n", (char *)buffer);
}
-
+ NetApiBufferFree(buffer);
libnetapi_free(ctx);
return status;
diff --git a/source3/lib/netapi/getdc.c b/source3/lib/netapi/getdc.c
index 85a0ae52ef..484af04a55 100644
--- a/source3/lib/netapi/getdc.c
+++ b/source3/lib/netapi/getdc.c
@@ -22,22 +22,6 @@
#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,
const char *domain_name,
@@ -76,17 +60,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 = ntstatus_to_werror(status);
done:
if (cli) {
cli_shutdown(cli);
@@ -175,22 +153,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);