Ignore:
Timestamp:
May 13, 2014, 11:39:04 AM (12 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update trunk to 3.6.23

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/smbd/server_reload.c

    r751 r862  
    3737                     struct messaging_context *msg_ctx)
    3838{
     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
    3983        struct auth_serversupplied_info *session_info = NULL;
    40         struct spoolss_PrinterInfo2 *pinfo2 = NULL;
    4184        int n_services;
    4285        int pnum;
     
    4689        NTSTATUS status;
    4790
    48         load_printers(ev, msg_ctx);
    49 
    5091        n_services = lp_numservices();
    5192        pnum = lp_servicenumber(PRINTERS_NAME);
    5293
    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);
    5695        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"));
    5997                /* can't remove stale printers before we
    6098                 * are fully initilized */
     
    82120                /* check printer, but avoid removing non-autoloaded printers */
    83121                if (lp_autoloaded(snum) && !pcap_printername_ok(pname)) {
    84                         DEBUG(3, ("removing stale printer %s\n", pname));
    85 
     122                        struct spoolss_PrinterInfo2 *pinfo2 = NULL;
    86123                        if (is_printer_published(session_info, session_info,
    87124                                                 msg_ctx,
    88                                                  NULL, lp_servicename(snum),
    89                                                  NULL, &pinfo2)) {
     125                                                 NULL,
     126                                                 lp_servicename(snum),
     127                                                 &pinfo2)) {
    90128                                nt_printer_publish(session_info,
    91129                                                   session_info,
     
    97135                        nt_printer_remove(session_info, session_info, msg_ctx,
    98136                                          pname);
    99                         lp_killservice(snum);
    100137                } else {
    101138                        DEBUG(8, ("Adding default registry entry for printer "
     
    106143        }
    107144
    108         /* Make sure deleted printers are gone */
    109         load_printers(ev, msg_ctx);
     145        /* */
     146        load_printers(ev, msg_ctx);
    110147
    111148        TALLOC_FREE(session_info);
     
    161198        return(ret);
    162199}
    163 
    164 /****************************************************************************
    165  Notify smbds of new printcap data
    166 **************************************************************************/
    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 that
    172          * newly added printers get default values created in the registry.
    173          *
    174          * This will block the process for some time (~1 sec per printer), but
    175          * 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.