summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-11-09 14:48:27 +0000
committerGerald Carter <jerry@samba.org>2002-11-09 14:48:27 +0000
commit4be3750d8e5edb849cf946def10891e0d4dd16d0 (patch)
treea2af152220ddd2c4d16a7e9cf95b2df1b18c9ddd /source3
parentb3f55b37a09551b6e782e58b3339b9caa4086d6d (diff)
downloadsamba-4be3750d8e5edb849cf946def10891e0d4dd16d0.tar.gz
samba-4be3750d8e5edb849cf946def10891e0d4dd16d0.tar.bz2
samba-4be3750d8e5edb849cf946def10891e0d4dd16d0.zip
deldriver fix
(This used to be commit f20de1f9b0dcac15fbf968e6d5d5af2fdd5fbda1)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/nt_status.h1
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c6
-rw-r--r--source3/rpcclient/cmd_spoolss.c17
3 files changed, 18 insertions, 6 deletions
diff --git a/source3/include/nt_status.h b/source3/include/nt_status.h
index 1c80c5ecde..9747f73eb1 100644
--- a/source3/include/nt_status.h
+++ b/source3/include/nt_status.h
@@ -58,5 +58,6 @@ typedef uint32 WERROR;
#define NT_STATUS_IS_ERR(x) ((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000)
#define NT_STATUS_EQUAL(x,y) (NT_STATUS_V(x) == NT_STATUS_V(y))
#define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0)
+#define W_ERROR_EQUAL(x,y) (W_ERROR_V(x) == W_ERROR_V(y))
#endif
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 5ebefc5ea0..f8262110ce 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -1908,6 +1908,12 @@ WERROR _spoolss_deleteprinterdriver(pipes_struct *p, SPOOL_Q_DELETEPRINTERDRIVER
goto done;
}
}
+ /* otherwise it was a failure */
+ else {
+ status = WERR_UNKNOWN_PRINTER_DRIVER;
+ goto done;
+ }
+
}
if (printer_driver_in_use(info.info_3)) {
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 4b5c6676e8..83096a3632 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -1259,16 +1259,21 @@ static NTSTATUS cmd_spoolss_deletedriver(struct cli_state *cli,
result = cli_spoolss_deleteprinterdriver(
cli, mem_ctx, archi_table[i].long_archi, argv[1]);
- if (!W_ERROR_IS_OK(result)) {
- printf ("Failed to remove driver %s for arch [%s] - error 0x%x!\n",
- argv[1], archi_table[i].long_archi,
- W_ERROR_V(result));
- } else
+ if ( !W_ERROR_IS_OK(result) ) {
+ if ( !W_ERROR_EQUAL(result, WERR_UNKNOWN_PRINTER_DRIVER) ) {
+ printf ("Failed to remove driver %s for arch [%s] - error 0x%x!\n",
+ argv[1], archi_table[i].long_archi,
+ W_ERROR_V(result));
+ }
+ }
+ else
+ {
printf ("Driver %s removed for arch [%s].\n", argv[1],
archi_table[i].long_archi);
+ }
}
- return W_ERROR_IS_OK(result) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ return W_ERROR_IS_OK(result) || W_ERROR_EQUAL(result, WERR_UNKNOWN_PRINTER_DRIVER) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
}
static NTSTATUS cmd_spoolss_getprintprocdir(struct cli_state *cli,