diff options
author | Jeremy Allison <jra@samba.org> | 2000-06-26 22:08:20 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-06-26 22:08:20 +0000 |
commit | 36fd3866efa89b5a537d4cb312e6a0d77ca9b89a (patch) | |
tree | a0957704d81dcc40f6ebd537eb4a0047497e2abc /source3/printing | |
parent | 990b8e5f7fbf965e9905514ac4e96ecb4539d38e (diff) | |
download | samba-36fd3866efa89b5a537d4cb312e6a0d77ca9b89a.tar.gz samba-36fd3866efa89b5a537d4cb312e6a0d77ca9b89a.tar.bz2 samba-36fd3866efa89b5a537d4cb312e6a0d77ca9b89a.zip |
Changing drivers using the properties page works - but only if getting/setting
security descriptors is disabled (as it is in this code).
If get/set sd's is enabled spooler.exe crashes on NT.
I'll investigate and fix that issue next.
Jeremy.
(This used to be commit 8c9ed874363e6a710bc0fe521bb8c4f7ee219587)
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/nt_printing.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index c000e1c978..30743a4113 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -513,7 +513,8 @@ static int pack_devicemode(NT_DEVICEMODE *nt_devmode, char *buf, int buflen) if (!nt_devmode) return len; - len += tdb_pack(buf+len, buflen-len, "fwwwwwwwwwwwwwwwwwwddddddddddddddp", + len += tdb_pack(buf+len, buflen-len, "ffwwwwwwwwwwwwwwwwwwddddddddddddddp", + nt_devmode->devicename, nt_devmode->formname, nt_devmode->specversion, @@ -785,7 +786,7 @@ static void free_nt_printer_param(NT_PRINTER_PARAM **param_ptr) Malloc and return an NT devicemode. ****************************************************************************/ -NT_DEVICEMODE *construct_nt_devicemode(void) +NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename) { /* * should I init this ones ??? @@ -801,6 +802,7 @@ NT_DEVICEMODE *construct_nt_devicemode(void) ZERO_STRUCTP(nt_devmode); + fstrcpy(nt_devmode->devicename, default_devicename); fstrcpy(nt_devmode->formname, "Letter"); nt_devmode->specversion = 0x0401; @@ -931,7 +933,8 @@ static int unpack_devicemode(NT_DEVICEMODE **nt_devmode, char *buf, int buflen) if (!*nt_devmode) return len; - len += tdb_unpack(buf+len, buflen-len, "fwwwwwwwwwwwwwwwwwwddddddddddddddp", + len += tdb_unpack(buf+len, buflen-len, "ffwwwwwwwwwwwwwwwwwwddddddddddddddp", + devmode.devicename, devmode.formname, &devmode.specversion, @@ -1037,7 +1040,7 @@ static uint32 get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstrin info.starttime = 0; /* Minutes since 12:00am GMT */ info.untiltime = 0; /* Minutes since 12:00am GMT */ - if ((info.devmode = construct_nt_devicemode()) == NULL) + if ((info.devmode = construct_nt_devicemode(info.printername)) == NULL) goto fail; if (!nt_printing_getsec(sharename, &info.secdesc_buf)) @@ -1078,7 +1081,11 @@ static uint32 get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharen kbuf.dsize = strlen(key)+1; dbuf = tdb_fetch(tdb, kbuf); +#if 1 /* JRATEST */ if (!dbuf.dptr) return get_a_printer_2_default(info_ptr, sharename); +#else + if (!dbuf.dptr) return 1; +#endif len += tdb_unpack(dbuf.dptr+len, dbuf.dsize-len, "dddddddddddffffffffff", &info.attributes, @@ -1108,7 +1115,9 @@ static uint32 get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharen len += unpack_devicemode(&info.devmode,dbuf.dptr+len, dbuf.dsize-len); len += unpack_specifics(&info.specific,dbuf.dptr+len, dbuf.dsize-len); +#if 0 /* JRATEST */ nt_printing_getsec(sharename, &info.secdesc_buf); +#endif /* JRATEST */ fstrcpy(info.sharename, ""); |