Changeset 862 for trunk/server/source3/smbd/server_reload.c
- Timestamp:
- May 13, 2014, 11:39:04 AM (12 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
source3/smbd/server_reload.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 860
- Property svn:mergeinfo changed
-
trunk/server/source3/smbd/server_reload.c
r751 r862 37 37 struct messaging_context *msg_ctx) 38 38 { 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 39 83 struct auth_serversupplied_info *session_info = NULL; 40 struct spoolss_PrinterInfo2 *pinfo2 = NULL;41 84 int n_services; 42 85 int pnum; … … 46 89 NTSTATUS status; 47 90 48 load_printers(ev, msg_ctx);49 50 91 n_services = lp_numservices(); 51 92 pnum = lp_servicenumber(PRINTERS_NAME); 52 93 53 DEBUG(10, ("reloading printer services from pcap cache\n")); 54 55 status = make_session_info_system(talloc_tos(), &session_info); 94 status = make_session_info_system(talloc_new(NULL), &session_info); 56 95 if (!NT_STATUS_IS_OK(status)) { 57 DEBUG(3, ("reload_printers: " 58 "Could not create system session_info\n")); 96 DEBUG(3, ("Could not create system session_info\n")); 59 97 /* can't remove stale printers before we 60 98 * are fully initilized */ … … 82 120 /* check printer, but avoid removing non-autoloaded printers */ 83 121 if (lp_autoloaded(snum) && !pcap_printername_ok(pname)) { 84 DEBUG(3, ("removing stale printer %s\n", pname)); 85 122 struct spoolss_PrinterInfo2 *pinfo2 = NULL; 86 123 if (is_printer_published(session_info, session_info, 87 124 msg_ctx, 88 NULL, lp_servicename(snum), 89 NULL, &pinfo2)) { 125 NULL, 126 lp_servicename(snum), 127 &pinfo2)) { 90 128 nt_printer_publish(session_info, 91 129 session_info, … … 97 135 nt_printer_remove(session_info, session_info, msg_ctx, 98 136 pname); 99 lp_killservice(snum);100 137 } else { 101 138 DEBUG(8, ("Adding default registry entry for printer " … … 106 143 } 107 144 108 /* Make sure deleted printers are gone*/109 load_printers(ev, msg_ctx);145 /* */ 146 load_printers(ev, msg_ctx); 110 147 111 148 TALLOC_FREE(session_info); … … 161 198 return(ret); 162 199 } 163 164 /****************************************************************************165 Notify smbds of new printcap data166 **************************************************************************/167 void reload_pcap_change_notify(struct tevent_context *ev,168 struct messaging_context *msg_ctx)169 {170 /*171 * Reload the printers first in the background process so that172 * newly added printers get default values created in the registry.173 *174 * This will block the process for some time (~1 sec per printer), but175 * it doesn't block smbd's servering clients.176 */177 reload_printers(ev, msg_ctx);178 179 message_send_all(msg_ctx, MSG_PRINTER_PCAP, NULL, 0, NULL);180 }
Note:
See TracChangeset
for help on using the changeset viewer.
