Refactoring: connect_dst_pipe uses ndr_syntax_id instead of pipe_idx
authorVolker Lendecke <vl@samba.org>
Sun, 20 Jul 2008 16:44:32 +0000 (18:44 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 21 Jul 2008 12:36:28 +0000 (14:36 +0200)
(This used to be commit 0f77746f36b98acc5171727fa3fc236af9fd2000)

source3/utils/net_proto.h
source3/utils/net_rpc.c
source3/utils/net_rpc_printer.c
source3/utils/net_util.c

index ae675ed1703469cc34274fb5aa9f17ae8268ceae..1e355e54a3e720a2b779ca5f17510f87a25a9640 100644 (file)
@@ -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,
index 5989fd4cf1c9c0f2b6dcf7be1dab73a60ac07e2f..f6b6d3a095a84856f279e57ed16dc7aa3e077c43 100644 (file)
@@ -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;
 
index fd938cbeaa7193913081801503407e001efa2f48..f4b305d4ab103c0adba4a3432210de40380520bb 100644 (file)
@@ -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;
 
index b976c6597012963da784279c53e5b5c557e45152..be00dde16efb4e4769d806b663e607fb8f8f45aa 100644 (file)
@@ -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"));