struct pipes_struct {
struct pipes_struct *next, *prev;
- char client_address[INET6_ADDRSTRLEN];
+ struct client_address *client_id;
struct auth_serversupplied_info *server_info;
struct messaging_context *msg_ctx;
struct rpc_pipe_client **presult);
struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
const struct ndr_syntax_id *syntax,
- const char *client_address,
+ struct client_address *client_id,
struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx);
NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx,
const struct ndr_syntax_id *abstract_syntax,
struct auth_serversupplied_info *serversupplied_info,
+ struct client_address *client_id,
struct messaging_context *msg_ctx,
struct rpc_pipe_client **presult);
NTSTATUS rpc_connect_spoolss_pipe(connection_struct *conn,
NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
const struct tsocket_address *local_address,
const struct tsocket_address *remote_address,
+ struct client_address *client_id,
struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx,
struct fake_file_handle **phandle);
status = rpc_pipe_open_internal(tmp_ctx,
&ndr_table_spoolss.syntax_id,
server_info,
+ NULL,
msg_ctx,
&spoolss_pipe);
if (!NT_STATUS_IS_OK(status)) {
struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx,
const struct ndr_syntax_id *syntax,
- const char *client_address,
+ struct client_address *client_id,
struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx)
{
DLIST_ADD(InternalPipes, p);
- strlcpy(p->client_address, client_address, sizeof(p->client_address));
+ p->client_id = client_id;
p->endian = RPC_LITTLE_ENDIAN;
NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx,
const struct ndr_syntax_id *abstract_syntax,
struct auth_serversupplied_info *serversupplied_info,
+ struct client_address *client_id,
struct messaging_context *msg_ctx,
struct rpc_pipe_client **presult)
{
result->abstract_syntax = *abstract_syntax;
result->transfer_syntax = ndr_transfer_syntax;
+ if (client_id == NULL) {
+ static struct client_address unknown;
+ strlcpy(unknown.addr, "<UNKNOWN>", sizeof(unknown.addr));
+ unknown.name = "<UNKNOWN>";
+ client_id = &unknown;
+ }
+
result->pipes_struct = make_internal_rpc_pipe_p(
- result, abstract_syntax, "", serversupplied_info, msg_ctx);
+ result, abstract_syntax, client_id, serversupplied_info,
+ msg_ctx);
if (result->pipes_struct == NULL) {
TALLOC_FREE(result);
return NT_STATUS_NO_MEMORY;
status = rpc_pipe_open_internal(p->mem_ctx, &ndr_table_lsarpc.syntax_id,
p->server_info,
+ p->client_id,
p->msg_ctx,
&cli);
if (!NT_STATUS_IS_OK(status)) {
ZERO_STRUCT(user_handle);
status = rpc_pipe_open_internal(mem_ctx, &ndr_table_samr.syntax_id,
- server_info, msg_ctx,
+ server_info, NULL, msg_ctx,
&cli);
if (!NT_STATUS_IS_OK(status)) {
goto out;
ZERO_STRUCT(user_handle);
status = rpc_pipe_open_internal(mem_ctx, &ndr_table_samr.syntax_id,
- server_info, msg_ctx,
+ server_info, NULL, msg_ctx,
&cli);
if (!NT_STATUS_IS_OK(status)) {
goto out;
NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
const struct tsocket_address *local_address,
const struct tsocket_address *remote_address,
+ struct client_address *client_id,
struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx,
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,
+ p = make_internal_rpc_pipe_p(handle, &syntax, client_id,
server_info, msg_ctx);
handle->type = FAKE_FILE_TYPE_NAMED_PIPE;
status = rpc_pipe_open_internal(conn,
&ndr_table_spoolss.syntax_id,
conn->server_info,
+ &conn->sconn->client_id,
conn->sconn->msg_ctx,
&conn->spoolss_pipe);
if (!NT_STATUS_IS_OK(status)) {
return WERR_BADFID;
DEBUG(10,("_spoolss_RemoteFindFirstPrinterChangeNotifyEx: "
- "client_address is %s\n", p->client_address));
+ "client_address is %s\n", p->client_id->addr));
- if (!interpret_string_addr(&client_ss, p->client_address,
+ if (!interpret_string_addr(&client_ss, p->client_id->addr,
AI_NUMERICHOST)) {
return WERR_SERVER_UNAVAILABLE;
}
{
/* add_printer_hook() will call reload_services() */
if (!add_printer_hook(tmp_ctx, p->server_info->ptok,
- printer, p->client_address,
+ printer, p->client_id->addr,
p->msg_ctx)) {
result = WERR_ACCESS_DENIED;
goto done;
if (*lp_addprinter_cmd() ) {
if ( !add_printer_hook(p->mem_ctx, p->server_info->ptok,
- info2, p->client_address,
+ info2, p->client_id->addr,
p->msg_ctx) ) {
return WERR_ACCESS_DENIED;
}
status = rpc_pipe_open_internal(mem_ctx,
&ndr_table_winreg.syntax_id,
server_info,
+ NULL,
msg_ctx,
&pipe_handle);
if (!NT_STATUS_IS_OK(status)) {
status = rpc_pipe_open_internal(mem_ctx, &ndr_table_srvsvc.syntax_id,
conn->server_info,
+ &conn->sconn->client_id,
conn->sconn->msg_ctx,
&cli);
if (!NT_STATUS_IS_OK(status)) {
status = rpc_pipe_open_internal(
talloc_tos(), &ndr_table_samr.syntax_id,
- conn->server_info, conn->sconn->msg_ctx, &samr_pipe);
+ conn->server_info, &conn->sconn->client_id,
+ conn->sconn->msg_ctx, &samr_pipe);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("api_RNetUserEnum: Could not connect to samr: %s\n",
nt_errstr(status)));
status = rpc_pipe_open_internal(
talloc_tos(), &ndr_table_samr.syntax_id,
- conn->server_info, conn->sconn->msg_ctx, &samr_pipe);
+ conn->server_info, &conn->sconn->client_id,
+ conn->sconn->msg_ctx, &samr_pipe);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("api_RNetUserEnum: Could not connect to samr: %s\n",
nt_errstr(status)));
status = rpc_pipe_open_internal(
talloc_tos(), &ndr_table_samr.syntax_id,
- conn->server_info, conn->sconn->msg_ctx, &samr_pipe);
+ conn->server_info, &conn->sconn->client_id,
+ conn->sconn->msg_ctx, &samr_pipe);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("api_RNetUserEnum: Could not connect to samr: %s\n",
nt_errstr(status)));
status = rpc_pipe_open_internal(mem_ctx, &ndr_table_samr.syntax_id,
conn->server_info,
+ &conn->sconn->client_id,
conn->sconn->msg_ctx,
&cli);
if (!NT_STATUS_IS_OK(status)) {
status = rpc_pipe_open_internal(mem_ctx, &ndr_table_samr.syntax_id,
conn->server_info,
+ &conn->sconn->client_id,
conn->sconn->msg_ctx,
&cli);
if (!NT_STATUS_IS_OK(status)) {
status = rpc_pipe_open_internal(mem_ctx, &ndr_table_srvsvc.syntax_id,
conn->server_info,
+ &conn->sconn->client_id,
conn->sconn->msg_ctx,
&cli);
if (!NT_STATUS_IS_OK(status)) {
status = rpc_pipe_open_internal(mem_ctx, &ndr_table_samr.syntax_id,
conn->server_info,
+ &conn->sconn->client_id,
conn->sconn->msg_ctx,
&cli);
if (!NT_STATUS_IS_OK(status)) {
status = np_open(fsp, name,
conn->sconn->local_address,
conn->sconn->remote_address,
+ &conn->sconn->client_id,
conn->server_info,
conn->sconn->msg_ctx,
&fsp->fake_file_handle);
status = rpc_pipe_open_internal(mem_ctx,
&ndr_table_samr.syntax_id,
server_info,
+ NULL,
winbind_messaging_context(),
&cli);
if (!NT_STATUS_IS_OK(status)) {
status = rpc_pipe_open_internal(mem_ctx,
&ndr_table_lsarpc.syntax_id,
server_info,
+ NULL,
winbind_messaging_context(),
&cli);
if (!NT_STATUS_IS_OK(status)) {