#include "includes.h"
#include "ntdomain.h"
+#include "librpc/rpc/dcesrv_core.h"
#include "librpc/gen_ndr/ndr_dfs.h"
#include "librpc/gen_ndr/ndr_dfs_scompat.h"
#include "msdfs.h"
WERROR _dfs_Add(struct pipes_struct *p, struct dfs_Add *r)
{
+ struct dcesrv_call_state *dce_call = p->dce_call;
+ struct dcesrv_connection *dcesrv_conn = dce_call->conn;
+ const struct tsocket_address *local_address =
+ dcesrv_connection_get_local_address(dcesrv_conn);
struct junction_map *jn = NULL;
struct referral *old_referral_list = NULL;
bool self_ref = False;
p->session_info,
r->in.path,
p->remote_address,
- p->local_address,
+ local_address,
true, /*allow_broken_path */
jn, &consumedcnt, &self_ref);
if(!NT_STATUS_IS_OK(status)) {
WERROR _dfs_Remove(struct pipes_struct *p, struct dfs_Remove *r)
{
+ struct dcesrv_call_state *dce_call = p->dce_call;
+ struct dcesrv_connection *dcesrv_conn = dce_call->conn;
+ const struct tsocket_address *local_address =
+ dcesrv_connection_get_local_address(dcesrv_conn);
struct junction_map *jn = NULL;
bool self_ref = False;
int consumedcnt = 0;
p->session_info,
r->in.dfs_entry_path,
p->remote_address,
- p->local_address,
+ local_address,
true, /*allow_broken_path */
jn, &consumedcnt, &self_ref);
if(!NT_STATUS_IS_OK(status)) {
WERROR _dfs_GetInfo(struct pipes_struct *p, struct dfs_GetInfo *r)
{
+ struct dcesrv_call_state *dce_call = p->dce_call;
+ struct dcesrv_connection *dcesrv_conn = dce_call->conn;
+ const struct tsocket_address *local_address =
+ dcesrv_connection_get_local_address(dcesrv_conn);
int consumedcnt = strlen(r->in.dfs_entry_path);
struct junction_map *jn = NULL;
bool self_ref = False;
p->session_info,
r->in.dfs_entry_path,
p->remote_address,
- p->local_address,
+ local_address,
true, /*allow_broken_path */
jn, &consumedcnt, &self_ref);
if(!NT_STATUS_IS_OK(status) ||
error_status_t _epm_Lookup(struct pipes_struct *p,
struct epm_Lookup *r)
{
+ struct dcesrv_call_state *dce_call = p->dce_call;
+ struct dcesrv_connection *dcesrv_conn = dce_call->conn;
struct policy_handle *entry_handle;
struct rpc_eps *eps;
TALLOC_CTX *tmp_ctx;
if (r->in.entry_handle == NULL ||
ndr_policy_handle_empty(r->in.entry_handle)) {
+ const struct tsocket_address *local_address =
+ dcesrv_connection_get_local_address(dcesrv_conn);
char *srv_addr = NULL;
DEBUG(7, ("_epm_Lookup: No entry_handle found, creating it.\n"));
goto done;
}
- if (p->local_address != NULL &&
- tsocket_address_is_inet(p->local_address, "ipv4"))
+ if (local_address != NULL &&
+ tsocket_address_is_inet(local_address, "ipv4"))
{
- srv_addr = tsocket_address_inet_addr_string(p->local_address,
- tmp_ctx);
+ srv_addr = tsocket_address_inet_addr_string(
+ local_address, tmp_ctx);
}
switch (r->in.inquiry_type) {
error_status_t _epm_Map(struct pipes_struct *p,
struct epm_Map *r)
{
+ struct dcesrv_call_state *dce_call = p->dce_call;
+ struct dcesrv_connection *dcesrv_conn = dce_call->conn;
struct policy_handle *entry_handle;
enum dcerpc_transport_t transport;
struct ndr_syntax_id ifid;
if (r->in.entry_handle == NULL ||
ndr_policy_handle_empty(r->in.entry_handle)) {
+ const struct tsocket_address *local_addr =
+ dcesrv_connection_get_local_address(dcesrv_conn);
char *local_address = NULL;
struct ndr_syntax_id_buf buf;
char *if_string = NULL;
DBG_INFO("Mapping interface %s\n", if_string);
if ((transport == NCACN_IP_TCP) &&
- tsocket_address_is_inet(p->local_address, "ip")) {
+ tsocket_address_is_inet(local_addr, "ip")) {
/*
* We don't have the host ip in the epm
* database. For NCACN_IP_TCP, add the IP that
* the client connected to.
*/
local_address = tsocket_address_inet_addr_string(
- p->local_address, tmp_ctx);
+ local_addr, tmp_ctx);
}
eps = epm_map_get_towers(
NTSTATUS _netr_NetrEnumerateTrustedDomains(struct pipes_struct *p,
struct netr_NetrEnumerateTrustedDomains *r)
{
+ struct dcesrv_call_state *dce_call = p->dce_call;
+ struct dcesrv_connection *dcesrv_conn = dce_call->conn;
+ const struct tsocket_address *local_address =
+ dcesrv_connection_get_local_address(dcesrv_conn);
NTSTATUS status;
NTSTATUS result = NT_STATUS_OK;
DATA_BLOB blob;
status = rpcint_binding_handle(p->mem_ctx,
&ndr_table_lsarpc,
p->remote_address,
- p->local_address,
+ local_address,
p->session_info,
p->msg_ctx,
&h);
struct netlogon_creds_CredentialState *creds)
{
struct dcesrv_call_state *dce_call = p->dce_call;
+ struct dcesrv_connection *dcesrv_conn = dce_call->conn;
+ const struct tsocket_address *local_address =
+ dcesrv_connection_get_local_address(dcesrv_conn);
NTSTATUS status = NT_STATUS_OK;
union netr_LogonLevel *logon = r->in.logon;
const char *nt_username, *nt_domain, *nt_workstation;
nt_username, nt_domain,
wksname,
p->remote_address,
- p->local_address,
+ local_address,
logon->network->identity_info.parameter_control,
logon->network->lm.data,
logon->network->lm.length,
nt_username, nt_domain,
nt_workstation,
p->remote_address,
- p->local_address,
+ local_address,
logon->password->identity_info.parameter_control,
chal,
logon->password->lmpassword.hash,
struct pipes_struct {
struct pipes_struct *next, *prev;
- const struct tsocket_address *local_address;
const struct tsocket_address *remote_address;
enum dcerpc_transport_t transport;
const char *pipe_name,
enum dcerpc_transport_t transport,
const struct tsocket_address *remote_address,
- const struct tsocket_address *local_address,
struct pipes_struct **_p)
{
struct pipes_struct *p;
return ENOMEM;
}
- if (local_address) {
- p->local_address = tsocket_address_copy(local_address, p);
- if (p->local_address == NULL) {
- talloc_free(p);
- return ENOMEM;
- }
- }
-
*_p = p;
return 0;
}
client->binding,
transport,
ncacn_conn->remote_client_addr,
- ncacn_conn->local_server_addr,
&ncacn_conn->p);
if (ret != 0) {
DBG_DEBUG("make_base_pipes_struct failed: %s\n",
#include "winbindd/winbindd_proto.h"
#include "rpc_client/cli_pipe.h"
#include "ntdomain.h"
+#include "librpc/rpc/dcesrv_core.h"
#include "librpc/gen_ndr/ndr_winbind.h"
#include "librpc/gen_ndr/ndr_winbind_scompat.h"
#include "../librpc/gen_ndr/ndr_netlogon_c.h"
NTSTATUS _winbind_SamLogon(struct pipes_struct *p,
struct winbind_SamLogon *r)
{
+ struct dcesrv_call_state *dce_call = p->dce_call;
+ struct dcesrv_connection *dcesrv_conn = dce_call->conn;
+ const struct tsocket_address *local_address =
+ dcesrv_connection_get_local_address(dcesrv_conn);
struct winbindd_domain *domain;
NTSTATUS status;
struct netr_IdentityInfo *identity_info = NULL;
challenge,
lm_response, nt_response,
p->remote_address,
- p->local_address,
+ local_address,
&r->out.authoritative,
true, /* skip_sam */
&flags,