s3-spoolss: downgrade v4 64bit driver requests to v3 drivers.
authorGünther Deschner <gd@samba.org>
Thu, 17 Jan 2013 23:22:31 +0000 (00:22 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 18 Jan 2013 20:50:23 +0000 (21:50 +0100)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
source3/rpc_server/spoolss/srv_spoolss_nt.c

index ef854b1c080488100e7f64d787db73ea3be18be6..54384b330fa6012fc54545b5815bbd81c26b797c 100644 (file)
@@ -5605,6 +5605,7 @@ WERROR _spoolss_GetPrinterDriver2(struct pipes_struct *p,
 {
        struct printer_handle *printer;
        WERROR result;
+       uint32_t version = r->in.client_major_version;
 
        int snum;
 
@@ -5629,13 +5630,19 @@ WERROR _spoolss_GetPrinterDriver2(struct pipes_struct *p,
                return WERR_BADFID;
        }
 
+       if (r->in.client_major_version == SPOOLSS_DRIVER_VERSION_2012) {
+               DEBUG(3,("_spoolss_GetPrinterDriver2: v4 driver requested, "
+                       "downgrading to v3\n"));
+               version = SPOOLSS_DRIVER_VERSION_200X;
+       }
+
        result = construct_printer_driver_info_level(p->mem_ctx,
                                                     get_session_info_system(),
                                                     p->msg_ctx,
                                                     r->in.level, r->out.info,
                                                     snum, printer->servername,
                                                     r->in.architecture,
-                                                    r->in.client_major_version);
+                                                    version);
        if (!W_ERROR_IS_OK(result)) {
                TALLOC_FREE(r->out.info);
                return result;