summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-10-19 22:13:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:00 -0500
commit4e18fa46d54b65a2145da769cb5e26b63eee1b1d (patch)
treed46a00214ca399edacdd8cbffc77be0f52ef8b27 /source3/printing
parent7d4eaf8a9b9de38c4bbd144e18eacde456a68250 (diff)
downloadsamba-4e18fa46d54b65a2145da769cb5e26b63eee1b1d.tar.gz
samba-4e18fa46d54b65a2145da769cb5e26b63eee1b1d.tar.bz2
samba-4e18fa46d54b65a2145da769cb5e26b63eee1b1d.zip
r3069: add 'force printername' service parameter for people that want to enforce printername == sharename for spoolss printing
(This used to be commit d47b8a0b4f348171df35b3b0028ce7d99fab8af3)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 14c0417f77..a69433df37 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/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);