Timestamp:
Nov 29, 2012, 1:59:04 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/smbd/server_reload.c

    r745 r751  
    3939        struct auth_serversupplied_info *session_info = NULL;
    4040        struct spoolss_PrinterInfo2 *pinfo2 = NULL;
     41
     42
    4143        int snum;
    42         int n_services = lp_numservices();
    43         int pnum = lp_servicenumber(PRINTERS_NAME);
    4444        const char *pname;
     45
    4546        NTSTATUS status;
    46         bool skip = false;
    4747
    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
    4953        DEBUG(10, ("reloading printer services from pcap cache\n"));
    5054
     
    5559                /* can't remove stale printers before we
    5660                 * are fully initilized */
    57                 skip = true;
     61                ;
    5862        }
    5963
    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) {
    6571                        continue;
     72
    6673
     74
     75
     76
     77
     78
     79
    6780                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)) {
    6984                        DEBUG(3, ("removing stale printer %s\n", pname));
    7085
     
    8398                                          pname);
    8499                        lp_killservice(snum);
     100
     101
     102
     103
     104
    85105                }
    86106        }
    87107
     108
    88109        load_printers(ev, msg_ctx);
    89110
     
    107128                        test = False;
    108129                }
     130
    109131        }
    110132
     
    146168                               struct messaging_context *msg_ctx)
    147169{
     170
     171
     172
     173
     174
     175
     176
     177
     178
    148179        message_send_all(msg_ctx, MSG_PRINTER_PCAP, NULL, 0, NULL);
    149180}
Note: See TracChangeset for help on using the changeset viewer.