I found a better way of handling deleted auto printers
authorAndrew Tridgell <tridge@samba.org>
Wed, 10 May 2000 11:48:30 +0000 (11:48 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 10 May 2000 11:48:30 +0000 (11:48 +0000)
source/param/loadparm.c

index 14da552dcb0f059cf980db8bc1fbd896f340e702..97901cae8e8357351ad2bd06e69aad1ed32b022d 100644 (file)
@@ -1423,6 +1423,7 @@ FN_LOCAL_STRING(lp_dfsmap,szDfsMap)
 FN_LOCAL_BOOL(lp_dfsmap_loaded,bDfsMapLoaded)
 #endif
 
+FN_LOCAL_BOOL(lp_autoloaded,autoloaded)
 FN_LOCAL_BOOL(lp_preexec_close,bPreexecClose)
 FN_LOCAL_BOOL(lp_rootpreexec_close,bRootpreexecClose)
 FN_LOCAL_BOOL(lp_revalidate,bRevalidate)
@@ -2802,21 +2803,9 @@ void lp_killunused(BOOL (*snumused)(int ))
 {
        int i;
        for (i=0;i<iNumServices;i++) {
-               BOOL killthisone;
-
                if (!VALID(i)) continue;
 
-               killthisone = (!snumused || !snumused(i));
-
-               /* we also want to remove autoloaded printers that are no longer
-                  in /etc/printcap */
-               if (!killthisone && 
-                   iSERVICE(i).autoloaded && iSERVICE(i).bPrint_ok && 
-                   !pcap_printername_ok(iSERVICE(i).szPrintername, NULL)) {
-                       killthisone = True;
-               }
-
-               if (killthisone) {
+               if (!snumused || !snumused(i)) {
                        iSERVICE(i).valid = False;
                        free_service(pSERVICE(i));
                }