mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
Found that the minimum priority is 1 and not 0 on NT.
Changed back the devicemode's devicename to "\\server\printer".
I'm 100% sure it is correct, it's what NT sends on the wire. And that's
the printer's name and NOT the port's name as it has to be unique. It must
also be a UNC because it's a remote printer (remote for the client).
J.F.
(This used to be commit a7098c47b6
)
This commit is contained in:
parent
55f9dc2027
commit
104217f3b0
@ -23,6 +23,7 @@
|
||||
#include "includes.h"
|
||||
|
||||
extern int DEBUGLEVEL;
|
||||
extern pstring global_myname;
|
||||
|
||||
static TDB_CONTEXT *tdb; /* used for driver files */
|
||||
|
||||
@ -793,6 +794,7 @@ NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename)
|
||||
nt_devmode->devicename
|
||||
*/
|
||||
|
||||
char adevice[32];
|
||||
NT_DEVICEMODE *nt_devmode = (NT_DEVICEMODE *)malloc(sizeof(NT_DEVICEMODE));
|
||||
|
||||
if (nt_devmode == NULL) {
|
||||
@ -802,7 +804,10 @@ NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename)
|
||||
|
||||
ZERO_STRUCTP(nt_devmode);
|
||||
|
||||
fstrcpy(nt_devmode->devicename, default_devicename);
|
||||
snprintf(adevice, sizeof(adevice), "\\\\%s\\%s", global_myname, default_devicename);
|
||||
fstrcpy(nt_devmode->devicename, adevice);
|
||||
|
||||
|
||||
fstrcpy(nt_devmode->formname, "Letter");
|
||||
|
||||
nt_devmode->specversion = 0x0401;
|
||||
@ -1039,6 +1044,8 @@ 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 */
|
||||
info.priority = 1;
|
||||
info.default_priority = 1;
|
||||
|
||||
if ((info.devmode = construct_nt_devicemode(info.printername)) == NULL)
|
||||
goto fail;
|
||||
|
@ -1033,7 +1033,7 @@ static void spoolss_notify_security_desc(int snum, SPOOL_NOTIFY_INFO_DATA *data,
|
||||
static void spoolss_notify_attributes(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
|
||||
{
|
||||
data->notify_data.value[0] = PRINTER_ATTRIBUTE_SHARED \
|
||||
| PRINTER_ATTRIBUTE_NETWORK \
|
||||
| PRINTER_ATTRIBUTE_LOCAL \
|
||||
| PRINTER_ATTRIBUTE_RAW_ONLY ;
|
||||
}
|
||||
|
||||
@ -1796,10 +1796,10 @@ static DEVICEMODE *construct_dev_mode(int snum, char *servername)
|
||||
|
||||
DEBUGADD(8,("loading DEVICEMODE\n"));
|
||||
|
||||
#if 1 /* JRATEST */
|
||||
snprintf(adevice, sizeof(adevice), "%s", ntdevmode->devicename);
|
||||
#if 0 /* JRATEST */
|
||||
snprintf(adevice, sizeof(adevice), "\\\\%s\\%s", global_myname, ntdevmode->devicename);
|
||||
#else /* JRATEST */
|
||||
snprintf(adevice, sizeof(adevice), "%s", printer->info_2->printername);
|
||||
snprintf(adevice, sizeof(adevice), "\\\\%s\\%s", global_myname, printer->info_2->printername);
|
||||
#endif /* JRATEST */
|
||||
init_unistr(&devmode->devicename, adevice);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user