merge from APPLIANCE_HEAD (mapping access_required 0x0 to
authorGerald Carter <jerry@samba.org>
Sat, 3 Feb 2001 23:45:59 +0000 (23:45 +0000)
committerGerald Carter <jerry@samba.org>
Sat, 3 Feb 2001 23:45:59 +0000 (23:45 +0000)
PRINTER_ACCESS_USE)
(This used to be commit 0c57b05de46f04dda941fcb4ba4f2a5a88b8dc9f)

source3/rpc_server/srv_spoolss_nt.c

index ff9dfabe69bea06553fad081f2d67b13a886daf1..fecdadbf08f0567844dfe435958eceda2739e7ee 100644 (file)
@@ -680,7 +680,7 @@ static struct current_user *get_current_user(struct current_user *user, pipes_st
  * called from the spoolss dispatcher
  ********************************************************************/
 uint32 _spoolss_open_printer_ex( const UNISTR2 *printername, pipes_struct *p,
-                                const PRINTER_DEFAULT *printer_default,
+                                PRINTER_DEFAULT *printer_default,
                                 uint32  user_switch, SPOOL_USER_CTR user_ctr,
                                 POLICY_HND *handle)
 {
@@ -747,7 +747,7 @@ uint32 _spoolss_open_printer_ex( const UNISTR2 *printername, pipes_struct *p,
                }
                else if ( (printer_default->access_required & SERVER_ACCESS_ADMINISTER ) == SERVER_ACCESS_ADMINISTER) {
 
-                       if (lp_ms_add_printer_wizard()) {
+                       if (!lp_ms_add_printer_wizard()) {
                                close_printer_handle(handle);
                                return ERROR_ACCESS_DENIED;
                        }
@@ -765,6 +765,10 @@ uint32 _spoolss_open_printer_ex( const UNISTR2 *printername, pipes_struct *p,
                if (!get_printer_snum(handle, &snum))
                        return ERROR_INVALID_HANDLE;
 
+               /* map an empty access mask to the minimum access mask */
+               if (printer_default->access_required == 0x0)
+                       printer_default->access_required = PRINTER_ACCESS_USE;
+
                if (!print_access_check(&user, snum, printer_default->access_required)) {
                        DEBUG(3, ("access DENIED for printer open\n"));
                        close_printer_handle(handle);