Otherwise this can only work with NCACN_NP...
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
struct rpc_pipe_client *passwordset_pipe = NULL;
struct cli_credentials *cli_creds;
struct netlogon_creds_cli_context *netlogon_creds = NULL;
+ const struct sockaddr_storage *remote_sockaddr = NULL;
size_t len = 0;
bool ok;
DATA_BLOB new_trust_blob = data_blob_null;
r->in.passed_machine_password,
CRED_SPECIFIED);
+ remote_sockaddr = smbXcli_conn_remote_sockaddr(cli->conn);
+
status = rpccli_create_netlogon_creds_ctx(cli_creds,
r->in.dc_name,
r->in.msg_ctx,
status = rpccli_connect_netlogon(cli,
NCACN_NP,
+ r->in.dc_name,
+ remote_sockaddr,
netlogon_creds,
true, /* force_reauth */
cli_creds,
struct netlogon_creds_cli_context *netlogon_creds = NULL;
NTSTATUS status;
int flags = CLI_FULL_CONNECTION_IPC;
+ const struct sockaddr_storage *remote_sockaddr = NULL;
if (!dc_name) {
TALLOC_FREE(frame);
return status;
}
+ remote_sockaddr = smbXcli_conn_remote_sockaddr(cli->conn);
+
status = rpccli_create_netlogon_creds_ctx(cli_creds,
dc_name,
msg_ctx,
status = rpccli_connect_netlogon(cli,
NCACN_NP,
+ dc_name,
+ remote_sockaddr,
netlogon_creds,
true, /* force_reauth */
cli_creds,
NTSTATUS rpccli_connect_netlogon(
struct cli_state *cli,
enum dcerpc_transport_t transport,
+ const char *remote_name,
+ const struct sockaddr_storage *remote_sockaddr,
struct netlogon_creds_cli_context *creds_ctx,
bool force_reauth,
struct cli_credentials *trust_creds,
struct rpc_pipe_client *rpccli;
NTSTATUS status;
bool retry = false;
- const char *remote_name = NULL;
- const struct sockaddr_storage *remote_sockaddr = NULL;
sec_chan_type = cli_credentials_get_secure_channel_type(trust_creds);
if (sec_chan_type == SEC_CHAN_NULL) {
}
}
- remote_name = smbXcli_conn_remote_name(cli->conn);
- remote_sockaddr = smbXcli_conn_remote_sockaddr(cli->conn);
-
do_serverauth = force_reauth || !found_existing_creds;
if (!do_serverauth) {
NTSTATUS rpccli_connect_netlogon(
struct cli_state *cli,
enum dcerpc_transport_t transport,
+ const char *remote_name,
+ const struct sockaddr_storage *remote_sockaddr,
struct netlogon_creds_cli_context *creds_ctx,
bool force_reauth,
struct cli_credentials *trust_creds,
NTSTATUS result;
enum netr_SchannelType sec_chan_type;
struct cli_credentials *creds = NULL;
+ const char *remote_name = NULL;
+ const struct sockaddr_storage *remote_sockaddr = NULL;
*cli = NULL;
TALLOC_FREE(conn->netlogon_pipe);
TALLOC_FREE(conn->netlogon_creds_ctx);
+ remote_name = smbXcli_conn_remote_name(conn->cli->conn);
+ remote_sockaddr = smbXcli_conn_remote_sockaddr(conn->cli->conn);
+
result = winbindd_get_trust_credentials(domain,
talloc_tos(),
true, /* netlogon */
sec_chan_type = cli_credentials_get_secure_channel_type(creds);
if (sec_chan_type == SEC_CHAN_NULL) {
- const char *remote_name =
- smbXcli_conn_remote_name(conn->cli->conn);
- const struct sockaddr_storage *remote_sockaddr =
- smbXcli_conn_remote_sockaddr(conn->cli->conn);
-
if (transport == NCACN_IP_TCP) {
DBG_NOTICE("get_secure_channel_type gave SEC_CHAN_NULL "
"for %s, deny NCACN_IP_TCP and let the "
return result;
}
- result = rpccli_connect_netlogon(
- conn->cli, transport,
- conn->netlogon_creds_ctx, conn->netlogon_force_reauth, creds,
- &conn->netlogon_pipe);
+ result = rpccli_connect_netlogon(conn->cli,
+ transport,
+ remote_name,
+ remote_sockaddr,
+ conn->netlogon_creds_ctx,
+ conn->netlogon_force_reauth, creds,
+ &conn->netlogon_pipe);
conn->netlogon_force_reauth = false;
if (!NT_STATUS_IS_OK(result)) {
DBG_DEBUG("rpccli_connect_netlogon failed: %s\n",