Changeset 751 for trunk/server/source3/smbd/server_reload.c
- Timestamp:
- Nov 29, 2012, 1:59:04 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/server/source3/smbd/server_reload.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/smbd/server_reload.c
r745 r751 39 39 struct auth_serversupplied_info *session_info = NULL; 40 40 struct spoolss_PrinterInfo2 *pinfo2 = NULL; 41 42 41 43 int snum; 42 int n_services = lp_numservices();43 int pnum = lp_servicenumber(PRINTERS_NAME);44 44 const char *pname; 45 45 46 NTSTATUS status; 46 bool skip = false;47 47 48 SMB_ASSERT(pcap_cache_loaded()); 48 load_printers(ev, msg_ctx); 49 50 n_services = lp_numservices(); 51 pnum = lp_servicenumber(PRINTERS_NAME); 52 49 53 DEBUG(10, ("reloading printer services from pcap cache\n")); 50 54 … … 55 59 /* can't remove stale printers before we 56 60 * are fully initilized */ 57 skip = true;61 ; 58 62 } 59 63 60 /* remove stale printers */ 61 for (snum = 0; skip == false && snum < n_services; snum++) { 62 /* avoid removing PRINTERS_NAME or non-autoloaded printers */ 63 if (snum == pnum || !(lp_snum_ok(snum) && lp_print_ok(snum) && 64 lp_autoloaded(snum))) 64 /* 65 * Add default config for printers added to smb.conf file and remove 66 * stale printers 67 */ 68 for (snum = 0; snum < n_services; snum++) { 69 /* avoid removing PRINTERS_NAME */ 70 if (snum == pnum) { 65 71 continue; 72 66 73 74 75 76 77 78 79 67 80 pname = lp_printername(snum); 68 if (!pcap_printername_ok(pname)) { 81 82 /* check printer, but avoid removing non-autoloaded printers */ 83 if (lp_autoloaded(snum) && !pcap_printername_ok(pname)) { 69 84 DEBUG(3, ("removing stale printer %s\n", pname)); 70 85 … … 83 98 pname); 84 99 lp_killservice(snum); 100 101 102 103 104 85 105 } 86 106 } 87 107 108 88 109 load_printers(ev, msg_ctx); 89 110 … … 107 128 test = False; 108 129 } 130 109 131 } 110 132 … … 146 168 struct messaging_context *msg_ctx) 147 169 { 170 171 172 173 174 175 176 177 178 148 179 message_send_all(msg_ctx, MSG_PRINTER_PCAP, NULL, 0, NULL); 149 180 }
Note:
See TracChangeset
for help on using the changeset viewer.
