summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-07-20 18:44:32 +0200
committerVolker Lendecke <vl@samba.org>2008-07-21 14:36:28 +0200
commit05cc3fda05ced80828d8a7bbc00674c495bf46d3 (patch)
treecc0e54e0cc63366c6f38d38552cfdba00980fe8b
parentd86ff599892608cf739c96e8add9b6ff9f9e5e43 (diff)
downloadsamba-05cc3fda05ced80828d8a7bbc00674c495bf46d3.tar.gz
samba-05cc3fda05ced80828d8a7bbc00674c495bf46d3.tar.bz2
samba-05cc3fda05ced80828d8a7bbc00674c495bf46d3.zip
Refactoring: connect_dst_pipe uses ndr_syntax_id instead of pipe_idx
(This used to be commit 0f77746f36b98acc5171727fa3fc236af9fd2000)
-rw-r--r--source3/utils/net_proto.h3
-rw-r--r--source3/utils/net_rpc.c6
-rw-r--r--source3/utils/net_rpc_printer.c15
-rw-r--r--source3/utils/net_util.c5
4 files changed, 19 insertions, 10 deletions
diff --git a/source3/utils/net_proto.h b/source3/utils/net_proto.h
index ae675ed170..1e355e54a3 100644
--- a/source3/utils/net_proto.h
+++ b/source3/utils/net_proto.h
@@ -448,7 +448,8 @@ NTSTATUS connect_to_ipc_krb5(struct net_context *c,
struct sockaddr_storage *server_ss,
const char *server_name);
NTSTATUS connect_dst_pipe(struct net_context *c, struct cli_state **cli_dst,
- struct rpc_pipe_client **pp_pipe_hnd, int pipe_num);
+ struct rpc_pipe_client **pp_pipe_hnd,
+ const struct ndr_syntax_id *interface);
int net_use_krb_machine_account(struct net_context *c);
int net_use_machine_account(struct net_context *c);
bool net_find_server(struct net_context *c,
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 5989fd4cf1..f6b6d3a095 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -3516,7 +3516,8 @@ static NTSTATUS rpc_share_migrate_shares_internals(struct net_context *c,
goto done;
/* connect destination PI_SRVSVC */
- nt_status = connect_dst_pipe(c, &cli_dst, &srvsvc_pipe, PI_SRVSVC);
+ nt_status = connect_dst_pipe(c, &cli_dst, &srvsvc_pipe,
+ &ndr_table_srvsvc.syntax_id);
if (!NT_STATUS_IS_OK(nt_status))
return nt_status;
@@ -3966,7 +3967,8 @@ static NTSTATUS rpc_share_migrate_security_internals(struct net_context *c,
goto done;
/* connect destination PI_SRVSVC */
- nt_status = connect_dst_pipe(c, &cli_dst, &srvsvc_pipe, PI_SRVSVC);
+ nt_status = connect_dst_pipe(c, &cli_dst, &srvsvc_pipe,
+ &ndr_table_srvsvc.syntax_id);
if (!NT_STATUS_IS_OK(nt_status))
return nt_status;
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index fd938cbeaa..f4b305d4ab 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -1434,7 +1434,8 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c,
DEBUG(3,("copying printer ACLs\n"));
/* connect destination PI_SPOOLSS */
- nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst, PI_SPOOLSS);
+ nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst,
+ &syntax_spoolss);
if (!NT_STATUS_IS_OK(nt_status))
return nt_status;
@@ -1596,7 +1597,8 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c,
DEBUG(3,("copying forms\n"));
/* connect destination PI_SPOOLSS */
- nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst, PI_SPOOLSS);
+ nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst,
+ &syntax_spoolss);
if (!NT_STATUS_IS_OK(nt_status))
return nt_status;
@@ -1786,7 +1788,8 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c,
DEBUG(3,("copying printer-drivers\n"));
- nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst, PI_SPOOLSS);
+ nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst,
+ &syntax_spoolss);
if (!NT_STATUS_IS_OK(nt_status))
return nt_status;
@@ -2007,7 +2010,8 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c,
DEBUG(3,("copying printers\n"));
/* connect destination PI_SPOOLSS */
- nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst, PI_SPOOLSS);
+ nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst,
+ &syntax_spoolss);
if (!NT_STATUS_IS_OK(nt_status))
return nt_status;
@@ -2177,7 +2181,8 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
DEBUG(3,("copying printer settings\n"));
/* connect destination PI_SPOOLSS */
- nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst, PI_SPOOLSS);
+ nt_status = connect_dst_pipe(c, &cli_dst, &pipe_hnd_dst,
+ &syntax_spoolss);
if (!NT_STATUS_IS_OK(nt_status))
return nt_status;
diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c
index b976c65970..be00dde16e 100644
--- a/source3/utils/net_util.c
+++ b/source3/utils/net_util.c
@@ -279,7 +279,8 @@ NTSTATUS connect_to_ipc_krb5(struct net_context *c,
* @return Normal NTSTATUS return.
**/
NTSTATUS connect_dst_pipe(struct net_context *c, struct cli_state **cli_dst,
- struct rpc_pipe_client **pp_pipe_hnd, int pipe_num)
+ struct rpc_pipe_client **pp_pipe_hnd,
+ const struct ndr_syntax_id *interface)
{
NTSTATUS nt_status;
char *server_name = SMB_STRDUP("127.0.0.1");
@@ -304,7 +305,7 @@ NTSTATUS connect_dst_pipe(struct net_context *c, struct cli_state **cli_dst,
return nt_status;
}
- nt_status = cli_rpc_pipe_open_noauth(cli_tmp, cli_get_iface(pipe_num),
+ nt_status = cli_rpc_pipe_open_noauth(cli_tmp, interface,
&pipe_hnd);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("couldn't not initialize pipe\n"));