summaryrefslogtreecommitdiff
path: root/source3/libsmb/dsgetdcname.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-01-26 01:39:33 +0100
committerGünther Deschner <gd@samba.org>2008-01-29 15:09:56 +0100
commit5ab43ae0d8e66a1fd4c877089df52282367be7dd (patch)
tree5785f26c014c563411b67bea2c47b5c7f9d03026 /source3/libsmb/dsgetdcname.c
parentd9a1282cc5e4a44495ec8ce20ef6dad6dc79c96b (diff)
downloadsamba-5ab43ae0d8e66a1fd4c877089df52282367be7dd.tar.gz
samba-5ab43ae0d8e66a1fd4c877089df52282367be7dd.tar.bz2
samba-5ab43ae0d8e66a1fd4c877089df52282367be7dd.zip
Eliminate remote tree of dsgetdcname (which will happen in libnetapi then).
Guenther (This used to be commit fd490d236b1fb73a75c457b75128c9b98719418f)
Diffstat (limited to 'source3/libsmb/dsgetdcname.c')
-rw-r--r--source3/libsmb/dsgetdcname.c114
1 files changed, 14 insertions, 100 deletions
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c
index 2a66d51400..e0be76cc85 100644
--- a/source3/libsmb/dsgetdcname.c
+++ b/source3/libsmb/dsgetdcname.c
@@ -891,72 +891,27 @@ static NTSTATUS dsgetdcname_rediscover(TALLOC_CTX *mem_ctx,
}
/********************************************************************
-********************************************************************/
-
-NTSTATUS dsgetdcname_remote(TALLOC_CTX *mem_ctx,
- const char *computer_name,
- const char *domain_name,
- struct GUID *domain_guid,
- const char *site_name,
- uint32_t flags,
- struct DS_DOMAIN_CONTROLLER_INFO **info)
-{
- WERROR werr;
- NTSTATUS status = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
- struct cli_state *cli = NULL;
- struct rpc_pipe_client *pipe_cli = NULL;
-
- status = cli_full_connection(&cli, NULL, computer_name,
- NULL, 0,
- "IPC$", "IPC",
- "",
- "",
- "",
- 0, Undefined, NULL);
-
- if (!NT_STATUS_IS_OK(status)) {
- goto done;
- }
-
- pipe_cli = cli_rpc_pipe_open_noauth(cli, PI_NETLOGON,
- &status);
- if (!pipe_cli) {
- goto done;
- }
-
- werr = rpccli_netlogon_dsr_getdcname(pipe_cli,
- mem_ctx,
- computer_name,
- domain_name,
- domain_guid,
- NULL,
- flags,
- info);
- status = werror_to_ntstatus(werr);
-
- done:
- cli_rpc_pipe_close(pipe_cli);
- if (cli) {
- cli_shutdown(cli);
- }
-
- return status;
-}
+ dsgetdcname.
-/********************************************************************
+ This will be the only public function here.
********************************************************************/
-NTSTATUS dsgetdcname_local(TALLOC_CTX *mem_ctx,
- const char *computer_name,
- const char *domain_name,
- struct GUID *domain_guid,
- const char *site_name,
- uint32_t flags,
- struct DS_DOMAIN_CONTROLLER_INFO **info)
+NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
+ const char *domain_name,
+ struct GUID *domain_guid,
+ const char *site_name,
+ uint32_t flags,
+ struct DS_DOMAIN_CONTROLLER_INFO **info)
{
NTSTATUS status = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
struct DS_DOMAIN_CONTROLLER_INFO *myinfo = NULL;
+ DEBUG(10,("dsgetdcname: domain_name: %s, "
+ "domain_guid: %s, site_name: %s, flags: 0x%08x\n",
+ domain_name,
+ domain_guid ? GUID_string(mem_ctx, domain_guid) : "(null)",
+ site_name, flags));
+
*info = NULL;
if (!check_allowed_required_flags(flags)) {
@@ -991,44 +946,3 @@ NTSTATUS dsgetdcname_local(TALLOC_CTX *mem_ctx,
return status;
}
-
-/********************************************************************
- dsgetdcname.
-
- This will be the only public function here.
-********************************************************************/
-
-NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
- const char *computer_name,
- const char *domain_name,
- struct GUID *domain_guid,
- const char *site_name,
- uint32_t flags,
- struct DS_DOMAIN_CONTROLLER_INFO **info)
-{
- DEBUG(10,("dsgetdcname: computer_name: %s, domain_name: %s, "
- "domain_guid: %s, site_name: %s, flags: 0x%08x\n",
- computer_name, domain_name,
- domain_guid ? GUID_string(mem_ctx, domain_guid) : "(null)",
- site_name, flags));
-
- *info = NULL;
-
- if (computer_name) {
- return dsgetdcname_remote(mem_ctx,
- computer_name,
- domain_name,
- domain_guid,
- site_name,
- flags,
- info);
- }
-
- return dsgetdcname_local(mem_ctx,
- computer_name,
- domain_name,
- domain_guid,
- site_name,
- flags,
- info);
-}