summaryrefslogtreecommitdiffstats
path: root/source/printing
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-10-19 22:13:08 +0000
committerGerald Carter <jerry@samba.org>2004-10-19 22:13:08 +0000
commit90fee86e59df073a03ebb9f51605346a31795ec0 (patch)
tree46fc2322c78cb6b4723f00a70ce0307ccb85e114 /source/printing
parent539c699b41f461c2172cc945a3d3d175b05e9a22 (diff)
downloadsamba-90fee86e59df073a03ebb9f51605346a31795ec0.tar.gz
samba-90fee86e59df073a03ebb9f51605346a31795ec0.tar.xz
samba-90fee86e59df073a03ebb9f51605346a31795ec0.zip
r3069: add 'force printername' service parameter for people that want to enforce printername == sharename for spoolss printing
Diffstat (limited to 'source/printing')
-rw-r--r--source/printing/nt_printing.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c
index 14c0417f776..a69433df37f 100644
--- a/source/printing/nt_printing.c
+++ b/source/printing/nt_printing.c
@@ -3357,7 +3357,8 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, const char *se
{
pstring key;
NT_PRINTER_INFO_LEVEL_2 info;
- int len = 0;
+ int len = 0;
+ int snum = lp_servicenumber(sharename);
TDB_DATA kbuf, dbuf;
fstring printername;
char adevice[MAXDEVICENAME];
@@ -3403,7 +3404,12 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, const char *se
/* Restore the stripped strings. */
slprintf(info.servername, sizeof(info.servername)-1, "\\\\%s", servername);
- slprintf(printername, sizeof(printername)-1, "\\\\%s\\%s", servername, info.printername);
+
+ if ( lp_force_printername(snum) )
+ slprintf(printername, sizeof(printername)-1, "\\\\%s\\%s", servername, sharename );
+ else
+ slprintf(printername, sizeof(printername)-1, "\\\\%s\\%s", servername, info.printername);
+
fstrcpy(info.printername, printername);
len += unpack_devicemode(&info.devmode,dbuf.dptr+len, dbuf.dsize-len);
@@ -3416,7 +3422,7 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, const char *se
* See comments in get_a_printer_2_default()
*/
- if (lp_default_devmode(lp_servicenumber(sharename)) && !info.devmode) {
+ if (lp_default_devmode(snum) && !info.devmode) {
DEBUG(8,("get_a_printer_2: Constructing a default device mode for [%s]\n",
printername));
info.devmode = construct_nt_devicemode(printername);