pipes_struct *get_next_internal_pipe(pipes_struct *p);
bool fsp_is_np(struct files_struct *fsp);
+struct tsocket_address;
NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
- const char *client_address,
+ const struct tsocket_address *local_address,
+ const struct tsocket_address *remote_address,
struct auth_serversupplied_info *server_info,
struct fake_file_handle **phandle);
bool np_read_in_progress(struct fake_file_handle *handle);
}
NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
- const char *client_address,
+ const struct tsocket_address *local_address,
+ const struct tsocket_address *remote_address,
struct auth_serversupplied_info *server_info,
struct fake_file_handle **phandle)
{
} else {
struct pipes_struct *p;
struct ndr_syntax_id syntax;
+ const char *client_address;
if (!is_known_pipename(name, &syntax)) {
TALLOC_FREE(handle);
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
+ if (tsocket_address_is_inet(remote_address, "ip")) {
+ client_address = tsocket_address_inet_addr_string(
+ remote_address,
+ talloc_tos());
+ if (client_address == NULL) {
+ TALLOC_FREE(handle);
+ return NT_STATUS_NO_MEMORY;
+ }
+ } else {
+ client_address = "";
+ }
+
p = make_internal_rpc_pipe_p(handle, &syntax, client_address,
server_info);
#include "includes.h"
+#include "smbd/globals.h"
#define PIPE "\\PIPE\\"
#define PIPELEN strlen(PIPE)
return status;
}
- status = np_open(fsp, name, conn->client_address,
+ status = np_open(fsp, name,
+ conn->sconn->local_address,
+ conn->sconn->remote_address,
conn->server_info, &fsp->fake_file_handle);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("np_open(%s) returned %s\n", name,