From deb638a7aca9b52ce11ce27c8107f6d189b40f38 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 3 Feb 2001 23:45:59 +0000 Subject: merge from APPLIANCE_HEAD (mapping access_required 0x0 to PRINTER_ACCESS_USE) (This used to be commit 0c57b05de46f04dda941fcb4ba4f2a5a88b8dc9f) --- source3/rpc_server/srv_spoolss_nt.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/rpc_server/srv_spoolss_nt.c') diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index ff9dfabe69..fecdadbf08 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -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); -- cgit