svn commit: samba r2957 - in trunk/source: include printing rpc_server

jerry at samba.org jerry at samba.org
Wed Oct 13 20:13:40 GMT 2004


Author: jerry
Date: 2004-10-13 20:13:39 +0000 (Wed, 13 Oct 2004)
New Revision: 2957

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/trunk/source&rev=2957&nolog=1

Log:
fixing a segfault uncovered by the changes for BUG 1519
Modified:
   trunk/source/include/rpc_spoolss.h
   trunk/source/printing/nt_printing.c
   trunk/source/rpc_server/srv_spoolss_nt.c


Changeset:
Modified: trunk/source/include/rpc_spoolss.h
===================================================================
--- trunk/source/include/rpc_spoolss.h	2004-10-13 20:09:46 UTC (rev 2956)
+++ trunk/source/include/rpc_spoolss.h	2004-10-13 20:13:39 UTC (rev 2957)
@@ -206,6 +206,7 @@
 
 #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

Modified: trunk/source/printing/nt_printing.c
===================================================================
--- trunk/source/printing/nt_printing.c	2004-10-13 20:09:46 UTC (rev 2956)
+++ trunk/source/printing/nt_printing.c	2004-10-13 20:13:39 UTC (rev 2957)
@@ -380,9 +380,11 @@
 	   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;
 }

Modified: trunk/source/rpc_server/srv_spoolss_nt.c
===================================================================
--- trunk/source/rpc_server/srv_spoolss_nt.c	2004-10-13 20:09:46 UTC (rev 2956)
+++ trunk/source/rpc_server/srv_spoolss_nt.c	2004-10-13 20:13:39 UTC (rev 2957)
@@ -3506,6 +3506,7 @@
 { 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 @@
 {	
 	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) {



More information about the samba-cvs mailing list