Correctly emulate NT in printer handle opening access rights.
authorJeremy Allison <jra@samba.org>
Thu, 11 Apr 2002 02:59:31 +0000 (02:59 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 11 Apr 2002 02:59:31 +0000 (02:59 +0000)
Jeremy.
(This used to be commit 42ae2334f21402c347aee560f08fd8e730481169)

source3/rpc_server/srv_spoolss_nt.c

index 23754602fba568e928390aac59a845949b876658..3bc91c24725efa5452477fd8c39bd8bdb01f7a23 100644 (file)
@@ -993,7 +993,6 @@ Can't find printer handle we created for printer %s\n", name ));
                /* map an empty access mask to the minimum access mask */
                if (printer_default->access_required == 0x0)
                        printer_default->access_required = PRINTER_ACCESS_USE;
-               
 
                /*
                 * If we are not serving the printer driver for this printer,
@@ -1013,6 +1012,12 @@ Can't find printer handle we created for printer %s\n", name ));
                        return WERR_ACCESS_DENIED;
                }
 
+               if ((printer_default->access_required & SPECIFIC_RIGHTS_MASK)& ~(PRINTER_ACCESS_ADMINISTER|PRINTER_ACCESS_USE)) {
+                       DEBUG(3, ("access DENIED for printer open - unknown bits\n"));
+                       close_printer_handle(p, handle);
+                       return WERR_ACCESS_DENIED;
+               }
+
                if (printer_default->access_required & PRINTER_ACCESS_ADMINISTER)
                        printer_default->access_required = PRINTER_ACCESS_ADMINISTER;
                else