summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_spoolss_nt.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2001-02-03 23:45:59 +0000
committerGerald Carter <jerry@samba.org>2001-02-03 23:45:59 +0000
commitdeb638a7aca9b52ce11ce27c8107f6d189b40f38 (patch)
treea7e45204025ec1914d8941b976eef481aa3e5c6e /source3/rpc_server/srv_spoolss_nt.c
parent01d45db46b5e9ad4e6b9c9552c74c655eeafa78b (diff)
downloadsamba-deb638a7aca9b52ce11ce27c8107f6d189b40f38.tar.gz
samba-deb638a7aca9b52ce11ce27c8107f6d189b40f38.tar.bz2
samba-deb638a7aca9b52ce11ce27c8107f6d189b40f38.zip
merge from APPLIANCE_HEAD (mapping access_required 0x0 to
PRINTER_ACCESS_USE) (This used to be commit 0c57b05de46f04dda941fcb4ba4f2a5a88b8dc9f)
Diffstat (limited to 'source3/rpc_server/srv_spoolss_nt.c')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c8
1 files changed, 6 insertions, 2 deletions
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);