summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2017-01-10 18:25:22 +0100
committerStefan Metzmacher <metze@samba.org>2017-01-12 15:35:13 +0100
commit34218e0448bca3fda9661c67f18bbd0b9886d079 (patch)
tree9a317cacc7264cf710508c31d843e9d9c6c0019d /source3
parent06e4d1c174b27f001ece0d57abed3e472674b2e4 (diff)
downloadsamba-34218e0448bca3fda9661c67f18bbd0b9886d079.tar.gz
s3-spoolss: Fix architecture handling in spoolss_DeletePrinterDriverEx call
Pair-Programmed-With: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/printing/nt_printing.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 394a3e5e7e1..c05fb04c836 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1374,7 +1374,7 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
{
int snum;
int n_services = lp_numservices();
- bool in_use = False;
+ bool in_use = false;
struct spoolss_PrinterInfo2 *pinfo2 = NULL;
WERROR result;
@@ -1399,7 +1399,7 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
}
if (strequal(r->driver_name, pinfo2->drivername)) {
- in_use = True;
+ in_use = true;
}
TALLOC_FREE(pinfo2);
@@ -1416,26 +1416,31 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
/* we can still remove the driver if there is one of
"Windows NT x86" version 2 or 3 left */
- if (!strequal("Windows NT x86", r->architecture)) {
+ if (strequal(SPOOLSS_ARCHITECTURE_NT_X86, r->architecture)) {
+ if (r->version == 2) {
+ werr = winreg_get_driver(mem_ctx, b,
+ r->architecture,
+ r->driver_name,
+ 3, &driver);
+ } else if (r->version == 3) {
+ werr = winreg_get_driver(mem_ctx, b,
+ r->architecture,
+ r->driver_name,
+ 2, &driver);
+ } else {
+ DBG_ERR("Unknown driver version (%d)\n",
+ r->version);
+ werr = WERR_UNKNOWN_PRINTER_DRIVER;
+ }
+ } else if (strequal(SPOOLSS_ARCHITECTURE_x64, r->architecture)) {
werr = winreg_get_driver(mem_ctx, b,
- "Windows NT x86",
+ SPOOLSS_ARCHITECTURE_NT_X86,
r->driver_name,
DRIVER_ANY_VERSION,
&driver);
- } else if (r->version == 2) {
- werr = winreg_get_driver(mem_ctx, b,
- "Windows NT x86",
- r->driver_name,
- 3, &driver);
- } else if (r->version == 3) {
- werr = winreg_get_driver(mem_ctx, b,
- "Windows NT x86",
- r->driver_name,
- 2, &driver);
} else {
- DEBUG(0, ("printer_driver_in_use: ERROR!"
- " unknown driver version (%d)\n",
- r->version));
+ DBG_ERR("Unknown driver architecture: %s\n",
+ r->architecture);
werr = WERR_UNKNOWN_PRINTER_DRIVER;
}
@@ -1443,7 +1448,7 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
if ( W_ERROR_IS_OK(werr) ) {
/* it's ok to remove the driver, we have other architctures left */
- in_use = False;
+ in_use = false;
talloc_free(driver);
}
}