summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2001-08-13 21:30:27 +0000
committerGerald Carter <jerry@samba.org>2001-08-13 21:30:27 +0000
commit26ceb74063b78abc58f773641da66b9043a5518a (patch)
treeff761f871740d109d8e83f7a192f9940bef90c6c
parente430190a66933bc89837daca04f8d524af0284fa (diff)
downloadsamba-26ceb74063b78abc58f773641da66b9043a5518a.tar.gz
samba-26ceb74063b78abc58f773641da66b9043a5518a.tar.bz2
samba-26ceb74063b78abc58f773641da66b9043a5518a.zip
merge from 2.2
(This used to be commit 7049217eb40dbe3de6c05fe43742d2f684501723)
-rw-r--r--source3/param/loadparm.c4
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c12
2 files changed, 16 insertions, 0 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index b004265261..992083df72 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -380,6 +380,7 @@ typedef struct
BOOL bBlockingLocks;
BOOL bInheritPerms;
BOOL bMSDfsRoot;
+ BOOL bUseClientDriver;
char dummy[3]; /* for alignment */
}
@@ -494,6 +495,7 @@ static service sDefault = {
True, /* bBlockingLocks */
False, /* bInheritPerms */
False, /* bMSDfsRoot */
+ False, /* bUseClientDriver */
"" /* dummy */
};
@@ -839,6 +841,7 @@ static struct parm_struct parm_table[] = {
{"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT},
{"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0},
+ {"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_PRINT},
{"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT},
{"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT},
{"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL},
@@ -1671,6 +1674,7 @@ FN_LOCAL_BOOL(lp_dos_filetime_resolution, bDosFiletimeResolution)
FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes)
FN_LOCAL_BOOL(lp_blocking_locks, bBlockingLocks)
FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms)
+FN_LOCAL_BOOL(lp_use_client_driver, bUseClientDriver)
FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask)
FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode)
FN_LOCAL_INTEGER(lp_security_mask, iSecurity_mask)
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 023c9a1203..0710f05870 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -811,6 +811,18 @@ uint32 _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u,
if (printer_default->access_required == 0x0)
printer_default->access_required = PRINTER_ACCESS_USE;
+ /*
+ * If we are not serving the printer driver for this printer,
+ * map PRINTER_ACCESS_ADMINISTER to PRINTER_ACCESS_USE. This
+ * will keep NT clients happy --jerry
+ */
+
+ if (lp_use_client_driver(snum)
+ && (printer_default->access_required & PRINTER_ACCESS_ADMINISTER))
+ {
+ 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(p, handle);