summaryrefslogtreecommitdiff
path: root/source3/lib/netapi/getdc.c
diff options
context:
space:
mode:
authorKarolin Seeger <kseeger@samba.org>2008-02-29 10:44:38 +0100
committerKarolin Seeger <kseeger@samba.org>2008-02-29 10:44:38 +0100
commitc4fbe2846231a6b322c1094c6a1dbf93b7305768 (patch)
tree09eb77a294f4acda131b41fe4c9bec4ed175eb16 /source3/lib/netapi/getdc.c
parent1a6415fc77c708b87c8e2ce6e7828f486ffc87ac (diff)
parent695b6662abe64a40061bfa05ede12173fc4b1945 (diff)
downloadsamba-c4fbe2846231a6b322c1094c6a1dbf93b7305768.tar.gz
samba-c4fbe2846231a6b322c1094c6a1dbf93b7305768.tar.bz2
samba-c4fbe2846231a6b322c1094c6a1dbf93b7305768.zip
Merge commit 'origin/v3-2-test' into v3-2-stable
Conflicts: WHATSNEW.txt (This used to be commit a390bcf9403df4cf4d5eef42b35ebccbe253882e)
Diffstat (limited to 'source3/lib/netapi/getdc.c')
-rw-r--r--source3/lib/netapi/getdc.c70
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;
}