summaryrefslogtreecommitdiff
path: root/source3/rpcclient/cmd_netlogon.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpcclient/cmd_netlogon.c')
-rw-r--r--source3/rpcclient/cmd_netlogon.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index 95d79b5825..12d8cf3052 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -28,7 +28,7 @@ static WERROR cmd_netlogon_logon_ctrl2(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr;
- const char *logon_server = cli->cli->desthost;
+ const char *logon_server = cli->desthost;
enum netr_LogonControlCode function_code = NETLOGON_CONTROL_REDISCOVER;
uint32_t level = 1;
union netr_CONTROL_DATA_INFORMATION data;
@@ -101,14 +101,15 @@ static WERROR cmd_netlogon_getanydcname(struct rpc_pipe_client *cli,
}
/* Make sure to wait for our DC's reply */
- old_timeout = cli_set_timeout(cli->cli, MAX(cli->cli->timeout,30000)); /* 30 seconds. */
+ old_timeout = rpccli_set_timeout(cli, 30000); /* 30 seconds. */
+ rpccli_set_timeout(cli, MAX(old_timeout, 30000)); /* At least 30 sec */
status = rpccli_netr_GetAnyDCName(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
argv[1],
&dcname,
&werr);
- cli_set_timeout(cli->cli, old_timeout);
+ rpccli_set_timeout(cli, old_timeout);
if (!NT_STATUS_IS_OK(status)) {
return ntstatus_to_werror(status);
@@ -140,14 +141,15 @@ static WERROR cmd_netlogon_getdcname(struct rpc_pipe_client *cli,
}
/* Make sure to wait for our DC's reply */
- old_timeout = cli_set_timeout(cli->cli, MAX(cli->cli->timeout,30000)); /* 30 seconds. */
+ old_timeout = rpccli_set_timeout(cli, 30000); /* 30 seconds. */
+ rpccli_set_timeout(cli, MAX(30000, old_timeout)); /* At least 30 sec */
status = rpccli_netr_GetDcName(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
argv[1],
&dcname,
&werr);
- cli_set_timeout(cli->cli, old_timeout);
+ rpccli_set_timeout(cli, old_timeout);
if (!NT_STATUS_IS_OK(status)) {
return ntstatus_to_werror(status);
@@ -171,7 +173,7 @@ static WERROR cmd_netlogon_dsr_getdcname(struct rpc_pipe_client *cli,
NTSTATUS result;
WERROR werr = WERR_OK;
uint32 flags = DS_RETURN_DNS_NAME;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
const char *domain_name;
struct GUID domain_guid = GUID_zero();
struct GUID site_guid = GUID_zero();
@@ -231,7 +233,7 @@ static WERROR cmd_netlogon_dsr_getdcnameex(struct rpc_pipe_client *cli,
WERROR result;
NTSTATUS status;
uint32_t flags = DS_RETURN_DNS_NAME;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
const char *domain_name;
const char *site_name = NULL;
struct GUID domain_guid = GUID_zero();
@@ -290,7 +292,7 @@ static WERROR cmd_netlogon_dsr_getdcnameex2(struct rpc_pipe_client *cli,
WERROR result;
NTSTATUS status;
uint32_t flags = DS_RETURN_DNS_NAME;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
const char *domain_name = NULL;
const char *client_account = NULL;
uint32_t mask = 0;
@@ -396,7 +398,7 @@ static WERROR cmd_netlogon_logon_ctrl(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr;
- const char *logon_server = cli->cli->desthost;
+ const char *logon_server = cli->desthost;
enum netr_LogonControlCode function_code = 1;
uint32_t level = 1;
union netr_CONTROL_QUERY_INFORMATION info;
@@ -560,7 +562,7 @@ static NTSTATUS cmd_netlogon_sam_sync(struct rpc_pipe_client *cli,
const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- const char *logon_server = cli->cli->desthost;
+ const char *logon_server = cli->desthost;
const char *computername = global_myname();
struct netr_Authenticator credential;
struct netr_Authenticator return_authenticator;
@@ -625,7 +627,7 @@ static NTSTATUS cmd_netlogon_sam_deltas(struct rpc_pipe_client *cli,
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32_t tmp;
- const char *logon_server = cli->cli->desthost;
+ const char *logon_server = cli->desthost;
const char *computername = global_myname();
struct netr_Authenticator credential;
struct netr_Authenticator return_authenticator;
@@ -759,7 +761,7 @@ static WERROR cmd_netlogon_gettrustrid(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr = WERR_GENERAL_FAILURE;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
const char *domain_name = lp_workgroup();
uint32_t rid = 0;
@@ -799,7 +801,7 @@ static WERROR cmd_netlogon_dsr_enumtrustdom(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr = WERR_GENERAL_FAILURE;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
uint32_t trust_flags = NETR_TRUST_FLAG_IN_FOREST;
struct netr_DomainTrustList trusts;
@@ -847,7 +849,7 @@ static WERROR cmd_netlogon_deregisterdnsrecords(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr = WERR_GENERAL_FAILURE;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
const char *domain = lp_workgroup();
const char *dns_host = NULL;
@@ -893,7 +895,7 @@ static WERROR cmd_netlogon_dsr_getforesttrustinfo(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr = WERR_GENERAL_FAILURE;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
const char *trusted_domain_name = NULL;
struct lsa_ForestTrustInformation *info = NULL;
uint32_t flags = 0;
@@ -939,7 +941,7 @@ static WERROR cmd_netlogon_enumtrusteddomains(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr = WERR_GENERAL_FAILURE;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
struct netr_Blob blob;
@@ -974,7 +976,7 @@ static WERROR cmd_netlogon_enumtrusteddomainsex(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr = WERR_GENERAL_FAILURE;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
struct netr_DomainTrustList list;
if (argc < 1 || argc > 3) {