From d097ea490525e7a35739dae6a295fd03ba52cfc0 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 5 Jan 2005 16:20:35 +0000 Subject: r4539: patch from Rob -- adding real printcap name cache function to speed up printcap reloads (This used to be commit 1cad5250932b963c2eb9b775221b13db386d601b) --- source3/smbd/service.c | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'source3/smbd/service.c') diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 3dcd803a7c..2e60adc636 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -152,10 +152,8 @@ int find_service(fstring service) int iPrinterService; if ((iPrinterService = lp_servicenumber(PRINTERS_NAME)) >= 0) { - const char *pszTemp = lp_printcapname(); - DEBUG(3,("checking whether %s is a valid printer name...\n", service)); - if ((pszTemp != NULL) && pcap_printername_ok(service, pszTemp)) { + if (pcap_printername_ok(service)) { DEBUG(3,("%s is a valid printer name\n", service)); DEBUG(3,("adding %s as a printer service\n", service)); lp_add_printer(service, iPrinterService); @@ -863,36 +861,3 @@ void close_cnum(connection_struct *conn, uint16 vuid) conn_free(conn); } - -/**************************************************************************** - Remove stale printers -****************************************************************************/ - -void remove_stale_printers( void ) -{ - int snum, iNumServices, printersServiceNum; - const char *pname; - - iNumServices = lp_numservices(); - printersServiceNum = lp_servicenumber( PRINTERS_NAME); - for( snum = 0; snum < iNumServices; snum++) { - - /* Never remove PRINTERS_NAME */ - - if ( snum == printersServiceNum) - continue; - pname = lp_printername( snum); - - /* Is snum an autoloaded print service and still - in the printing subsystem? */ - - if ( lp_snum_ok(snum) - && lp_print_ok(snum) - && lp_autoloaded(snum) - && !pcap_printername_ok( pname, NULL)) - { - DEBUG( 3, ( "Removing printer: %s\n", pname)); - lp_killservice( snum); - } - } -} -- cgit