summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-08-23 03:34:24 +0000
committerGerald Carter <jerry@samba.org>2003-08-23 03:34:24 +0000
commit983b4e7011174961748eb5d3011ec59b25d0917e (patch)
tree7d18d852e5938b044b6e295fec446cad62ca9ff8 /source3/printing
parentdac11b890b3e81f8849340e582b7f397a612baba (diff)
downloadsamba-983b4e7011174961748eb5d3011ec59b25d0917e.tar.gz
samba-983b4e7011174961748eb5d3011ec59b25d0917e.tar.bz2
samba-983b4e7011174961748eb5d3011ec59b25d0917e.zip
it never amazes me when some new things crawls out of the windows
spooler. :-( When installing the Adobe PS driver onto a Samba printer via cupsaddsmb, I noticed a WIN2k client sending DeletePrinterData("DependentFiles") pver and over. I also noticed that we never checked to see if the value was valid. No now we do and return WERR_BADFILE which I think is correct. Next, I noticed that we never wrote the updated printer out to disk after a succesfully DeletePrinterData[Ex](). Finally, I found a driver (Canon BJC 1000 using the Adobe PS drivers and foomatic PPD file) that was destroying the device name string in the devmode. So now get_a_printer_2() always writes out the device name in \\server\share form. I think these changes might fix bug 294. (This used to be commit deb25780874b66e68ac597db24fbc50e7f7458b5)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 60a6ecba4b..294b9c9018 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -2256,7 +2256,7 @@ int unpack_devicemode(NT_DEVICEMODE **nt_devmode, char *buf, int buflen)
int len = 0;
int extra_len = 0;
NT_DEVICEMODE devmode;
-
+
ZERO_STRUCT(devmode);
len += tdb_unpack(buf+len, buflen-len, "p", nt_devmode);
@@ -3206,6 +3206,7 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, const char *sh
int len = 0;
TDB_DATA kbuf, dbuf;
fstring printername;
+ char adevice[MAXDEVICENAME];
ZERO_STRUCT(info);
@@ -3266,6 +3267,10 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, const char *sh
printername));
info.devmode = construct_nt_devicemode(printername);
}
+
+ safe_strcpy(adevice, info.printername, sizeof(adevice)-1);
+ fstrcpy(info.devmode->devicename, adevice);
+
len += unpack_values( &info.data, dbuf.dptr+len, dbuf.dsize-len );