r2955: fixing a segfault uncovered by the changes for BUG 1519
authorGerald Carter <jerry@samba.org>
Wed, 13 Oct 2004 19:40:22 +0000 (19:40 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:57 +0000 (10:52 -0500)
(This used to be commit 1664395257eb2425246e200ebde4384aa54484a4)

source3/include/rpc_spoolss.h
source3/printing/nt_printing.c
source3/rpc_server/srv_spoolss_nt.c

index f2b78f91bc08691f39e7003b4996673bd4201f0f..7c5942759f4290263b1fbd467b54094dad1b601f 100755 (executable)
 
 #define PRINTER_NOTIFY_TYPE 0x00
 #define JOB_NOTIFY_TYPE     0x01
+#define PRINT_TABLE_END     0xFF
 
 #define MAX_PRINTER_NOTIFY 26
 #define MAX_JOB_NOTIFY 24
index 81d792463a5dd697912e3889f079203635152dca..6474516ebcdec3b71007a97c9661db9b1dc0e95a 100644 (file)
@@ -380,9 +380,11 @@ BOOL nt_printing_init(void)
           msgs.  This is done in claim_connection() */
 
 
-       win_rc = check_published_printers();
-       if (!W_ERROR_IS_OK(win_rc))
-               DEBUG(0, ("nt_printing_init: error checking published printers: %s\n", dos_errstr(win_rc)));
+       if ( lp_security() == SEC_ADS ) {
+               win_rc = check_published_printers();
+               if (!W_ERROR_IS_OK(win_rc))
+                       DEBUG(0, ("nt_printing_init: error checking published printers: %s\n", dos_errstr(win_rc)));
+       }
 
        return True;
 }
index a1db4c38548979a765fb2a3bd170372682134a58..c882cea59b0f2528dea19cbe73921810fb60452e 100644 (file)
@@ -3506,6 +3506,7 @@ static const struct s_notify_info_data_table notify_info_data_table[] =
 { JOB_NOTIFY_TYPE,     JOB_NOTIFY_TOTAL_PAGES,             "JOB_NOTIFY_TOTAL_PAGES",             NOTIFY_ONE_VALUE, spoolss_notify_total_pages },
 { JOB_NOTIFY_TYPE,     JOB_NOTIFY_PAGES_PRINTED,           "JOB_NOTIFY_PAGES_PRINTED",           NOTIFY_ONE_VALUE, spoolss_notify_pages_printed },
 { JOB_NOTIFY_TYPE,     JOB_NOTIFY_TOTAL_BYTES,             "JOB_NOTIFY_TOTAL_BYTES",             NOTIFY_ONE_VALUE, spoolss_notify_job_size },
+{ PRINT_TABLE_END, 0x0, NULL, 0x0, NULL },
 };
 
 /*******************************************************************
@@ -3571,7 +3572,7 @@ static int search_notify(uint16 type, uint16 field, int *value)
 {      
        int i;
 
-       for (i = 0; i < sizeof(notify_info_data_table); i++) {
+       for (i = 0; notify_info_data_table[i].type != PRINT_TABLE_END; i++) {
                if (notify_info_data_table[i].type == type &&
                    notify_info_data_table[i].field == field &&
                    notify_info_data_table[i].fn != NULL) {