summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-10-06 20:03:17 +0000
committerJeremy Allison <jra@samba.org>2000-10-06 20:03:17 +0000
commit1126775808f434c3df4089159512988df82cbdd5 (patch)
treea022526ca22298894c11524b55e016b34583f4dd
parentba00796e6dd13b87b7988a98e532676d9eab702c (diff)
downloadsamba-1126775808f434c3df4089159512988df82cbdd5.tar.gz
samba-1126775808f434c3df4089159512988df82cbdd5.tar.bz2
samba-1126775808f434c3df4089159512988df82cbdd5.zip
Proto update. Also fix from John Reilly @ HP for not showing APW with W2K.
Jeremy. (This used to be commit 698288cb9de316527c0c2a271e18c920578f9930)
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c21
2 files changed, 15 insertions, 7 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 22c3f48f86..6c87c429c0 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -3862,6 +3862,7 @@ BOOL vfswrap_lock(files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T
size_t vfswrap_fget_nt_acl(files_struct *fsp, int fd, SEC_DESC **ppdesc);
size_t vfswrap_get_nt_acl(files_struct *fsp, char *name, SEC_DESC **ppdesc);
BOOL vfswrap_fset_nt_acl(files_struct *fsp, int fd, uint32 security_info_sent, SEC_DESC *psd);
+BOOL vfswrap_set_nt_acl(files_struct *fsp, char *name, uint32 security_info_sent, SEC_DESC *psd);
/*The following definitions come from smbd/vfs.c */
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 5a724d6ab6..56de5375fb 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -680,14 +680,21 @@ uint32 _spoolss_open_printer_ex( const UNISTR2 *printername,
return ERROR_ACCESS_DENIED;
}
- /* Disallow MS AddPrinterWizard if access rights are insufficient OR
- if parameter disables it. The client tries an OpenPrinterEx with
- SERVER_ALL_ACCESS(0xf0003), which we force to fail. It then tries
- OpenPrinterEx with SERVER_READ(0x20002) which we allow. This lets
- it see any printers there, but does not show the MSAPW */
+ /* Disallow MS AddPrinterWizard if parameter disables it. A Win2k
+ client 1st tries an OpenPrinterEx with access==0, MUST be allowed.
+ Then both Win2k and WinNT clients try an OpenPrinterEx with
+ SERVER_ALL_ACCESS, which we force to fail. Then they try
+ OpenPrinterEx with SERVER_READ which we allow. This lets the
+ client view printer folder, but does not show the MSAPW.
+
+ Note: this test needs code to check access rights here too. Jeremy
+ could you look at this? */
+
if (handle_is_printserver(handle) &&
- printer_default->access_required != (SERVER_READ) &&
- !lp_ms_add_printer_wizard() ) {
+ !lp_ms_add_printer_wizard()) {
+ if (printer_default->access_required == 0)
+ return NT_STATUS_NO_PROBLEMO;
+ else if (printer_default->access_required != (SERVER_READ))
return ERROR_ACCESS_DENIED;
}