fix for CR 601. Only call addprinter command when the port, driver, comment, or...
authorGerald Carter <jerry@samba.org>
Mon, 11 Nov 2002 22:05:32 +0000 (22:05 +0000)
committerGerald Carter <jerry@samba.org>
Mon, 11 Nov 2002 22:05:32 +0000 (22:05 +0000)
(This used to be commit 62a19247d31b1e5b81767880182b40ba396b261a)

source3/rpc_server/srv_spoolss_nt.c

index 2227d39f44c39c7d5f6c6ac56654098151d5d4b6..871aac8e68e403649ee3843b6813df156e9a46bb 100644 (file)
@@ -5780,8 +5780,14 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level,
        }
 
        /* Call addprinter hook */
-
-       if (*lp_addprinter_cmd()) {
+       /* Check changes to see if this is really needed */
+       
+       if ( *lp_addprinter_cmd() 
+               && (!strequal(printer->info_2->drivername, old_printer->info_2->drivername)
+                       || !strequal(printer->info_2->comment, old_printer->info_2->comment)
+                       || !strequal(printer->info_2->portname, old_printer->info_2->portname)
+                       || !strequal(printer->info_2->location, old_printer->info_2->location)) )
+       {
                if ( !add_printer_hook(printer) ) {
                        result = WERR_ACCESS_DENIED;
                        goto done;