s3-printing: remove spoolss pipe from migration library, only using winreg finally.
[samba.git] / source3 / utils / net_printing.c
index df7b56a380aed033a510e817dd0f4a809c387a65..29973edc1cb3424915bec8c17770c66095552703 100644 (file)
@@ -224,7 +224,7 @@ static NTSTATUS printing_migrate_internal(struct net_context *c,
                                          const struct dom_sid *domain_sid,
                                          const char *domain_name,
                                          struct cli_state *cli,
-                                         struct rpc_pipe_client *pipe_hnd,
+                                         struct rpc_pipe_client *winreg_pipe,
                                          TALLOC_CTX *mem_ctx,
                                          int argc,
                                          const char **argv)
@@ -233,22 +233,12 @@ static NTSTATUS printing_migrate_internal(struct net_context *c,
        TDB_CONTEXT *tdb;
        TDB_DATA kbuf, newkey, dbuf;
        NTSTATUS status;
-       struct rpc_pipe_client *winreg_pipe = NULL;
 
        tmp_ctx = talloc_new(mem_ctx);
        if (tmp_ctx == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
 
-       status = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(pipe_hnd),
-                                         &ndr_table_winreg.syntax_id,
-                                         &winreg_pipe);
-       if (!NT_STATUS_IS_OK(status)) {
-               d_fprintf(stderr, _("failed to open winreg pipe: %s\n"),
-                       nt_errstr(status));
-               goto done;
-       }
-
        tdb = tdb_open_log(argv[0], 0, TDB_DEFAULT, O_RDONLY, 0600);
        if (tdb == NULL) {
                d_fprintf(stderr, _("failed to open tdb file: %s\n"), argv[0]);
@@ -267,7 +257,6 @@ static NTSTATUS printing_migrate_internal(struct net_context *c,
 
                if (strncmp((const char *) kbuf.dptr, FORMS_PREFIX, strlen(FORMS_PREFIX)) == 0) {
                        printing_tdb_migrate_form(tmp_ctx,
-                                    pipe_hnd,
                                     winreg_pipe,
                                     (const char *) kbuf.dptr + strlen(FORMS_PREFIX),
                                     dbuf.dptr,
@@ -278,7 +267,6 @@ static NTSTATUS printing_migrate_internal(struct net_context *c,
 
                if (strncmp((const char *) kbuf.dptr, DRIVERS_PREFIX, strlen(DRIVERS_PREFIX)) == 0) {
                        printing_tdb_migrate_driver(tmp_ctx,
-                                      pipe_hnd,
                                       winreg_pipe,
                                       (const char *) kbuf.dptr + strlen(DRIVERS_PREFIX),
                                       dbuf.dptr,
@@ -289,7 +277,6 @@ static NTSTATUS printing_migrate_internal(struct net_context *c,
 
                if (strncmp((const char *) kbuf.dptr, PRINTERS_PREFIX, strlen(PRINTERS_PREFIX)) == 0) {
                        printing_tdb_migrate_printer(tmp_ctx,
-                                       pipe_hnd,
                                        winreg_pipe,
                                        (const char *) kbuf.dptr + strlen(PRINTERS_PREFIX),
                                        dbuf.dptr,
@@ -300,7 +287,6 @@ static NTSTATUS printing_migrate_internal(struct net_context *c,
 
                if (strncmp((const char *) kbuf.dptr, SECDESC_PREFIX, strlen(SECDESC_PREFIX)) == 0) {
                        printing_tdb_migrate_secdesc(tmp_ctx,
-                                       pipe_hnd,
                                        winreg_pipe,
                                        (const char *) kbuf.dptr + strlen(SECDESC_PREFIX),
                                        dbuf.dptr,
@@ -333,7 +319,7 @@ static int net_printing_migrate(struct net_context *c,
 
        return run_rpc_command(c,
                               NULL,
-                              &ndr_table_spoolss.syntax_id,
+                              &ndr_table_winreg.syntax_id,
                               0,
                               printing_migrate_internal,
                               argc,