s3-rpcclient: Fix bug #7880: cmd_spoolss_deletedriver() returned without checking...
authorBjörn Baumbach <bb@sernet.de>
Wed, 22 Dec 2010 14:20:29 +0000 (15:20 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 17 Jan 2011 17:08:34 +0000 (18:08 +0100)
Continues now with next architecture if no driver is available.

Because of the broken behavior of the rpccli_*() functions,
we need special error code handling.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit f5af66e67d7c6d62315671c0cf57f47973316226)
(cherry picked from commit dc63f45b523deb5c3d0c4be4239507e5fc4f6a40)
(cherry picked from commit fbcecec057bc05d6fcbdab3ef90d32c56335e833)

source3/rpcclient/cmd_spoolss.c

index d704e6ec60f0747272c403857d613ed3acbac7ce..44502687a62dde69e52cca7f86d8a697864fbd4c 100644 (file)
@@ -1918,6 +1918,8 @@ static WERROR cmd_spoolss_deletedriver(struct rpc_pipe_client *cli,
 
        /* delete the driver for all architectures */
        for (i=0; archi_table[i].long_archi; i++) {
+               result = WERR_OK;
+
                /* make the call to remove the driver */
                status = rpccli_spoolss_DeletePrinterDriver(cli, mem_ctx,
                                                            cli->srv_name_slash,
@@ -1925,7 +1927,9 @@ static WERROR cmd_spoolss_deletedriver(struct rpc_pipe_client *cli,
                                                            argv[1],
                                                            &result);
                if (!NT_STATUS_IS_OK(status)) {
-                       return result;
+                       if (W_ERROR_IS_OK(result)) {
+                               result = ntstatus_to_werror(status);
+                       }
                }
                if ( !W_ERROR_IS_OK(result) ) {
                        if ( !W_ERROR_EQUAL(result, WERR_UNKNOWN_PRINTER_DRIVER) ) {