1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00

merge from 2.2

This commit is contained in:
Gerald Carter 0001-01-01 00:00:00 +00:00
parent d082d3a9fc
commit 09fc979172

View File

@ -4422,6 +4422,8 @@ static BOOL add_printer_hook(NT_PRINTER_INFO_LEVEL *printer)
return True;
}
#if 0 /* JERRY */
/* Return true if two devicemodes are equal */
#define DEVMODE_CHECK_INT(field) \
@ -4431,6 +4433,10 @@ static BOOL add_printer_hook(NT_PRINTER_INFO_LEVEL *printer)
return False; \
}
/************************************************************************
Handy, but currently unused functions
***********************************************************************/
static BOOL nt_devicemode_equal(NT_DEVICEMODE *d1, NT_DEVICEMODE *d2)
{
if (!d1 && !d2) goto equal; /* if both are NULL they are equal */
@ -4662,6 +4668,8 @@ static BOOL nt_printer_info_level_equal(NT_PRINTER_INFO_LEVEL *p1,
return True;
}
#endif
/********************************************************************
* Called by spoolss_api_setprinter
* when updating a printer description.
@ -4735,9 +4743,13 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
goto done;
}
/* NT likes to call this function even though nothing has actually
changed. Check this so the user doesn't end up with an
annoying permission denied dialog box. */
#if 0 /* JERRY */
/*
* Another one of those historical misunderstandings...
* This is reminisent of a similar call we had in _spoolss_setprinterdata()
* I'm leaving it here as a reminder. --jerry
*/
if (nt_printer_info_level_equal(printer, old_printer)) {
DEBUG(3, ("update_printer: printer info has not changed\n"));
@ -4745,6 +4757,8 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
goto done;
}
#endif
/* Check calling user has permission to update printer description */
if (!print_access_check(NULL, snum, PRINTER_ACCESS_ADMINISTER)) {
@ -4784,7 +4798,7 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
* lookup previously saved driver initialization info, which is then
* bound to the printer, simulating what happens in the Windows arch.
*/
if (strequal(printer->info_2->drivername, old_printer->info_2->drivername))
if (!strequal(printer->info_2->drivername, old_printer->info_2->drivername))
set_driver_init(printer, 2);
}