[Pkg-cups-devel] r350 - in cupsys/branches/cups-1.2/debian: .

Kenshi Muto kmuto at costa.debian.org
Sun Aug 13 09:07:25 UTC 2006


Author: kmuto
Date: Sun Aug 13 09:07:24 2006
New Revision: 350

Added:
   cupsys/branches/cups-1.2/debian/patches/62_classes_crash.dpatch   (contents, props changed)
Modified:
   cupsys/branches/cups-1.2/debian/changelog
   cupsys/branches/cups-1.2/debian/patches/00list

Log:
add 62_classes_crash

Modified: cupsys/branches/cups-1.2/debian/changelog
==============================================================================
--- cupsys/branches/cups-1.2/debian/changelog	(original)
+++ cupsys/branches/cups-1.2/debian/changelog	Sun Aug 13 09:07:24 2006
@@ -18,6 +18,9 @@
   * 44_fixconfdirperms: set owner lp for /etc/cups directory.
     And modify lppasswd.man to mention about Debian
     specific changes. lppasswd command now work. (closes: #378062)
+  * 62_classes_crash: when class hasn't any printers, cupsd will
+    crash immedieately after receiving a job. This patch avoids
+    a crash.
 
  -- Kenshi Muto <kmuto at debian.org>  Thu, 27 Jul 2006 23:40:54 +0900
 

Modified: cupsys/branches/cups-1.2/debian/patches/00list
==============================================================================
--- cupsys/branches/cups-1.2/debian/patches/00list	(original)
+++ cupsys/branches/cups-1.2/debian/patches/00list	Sun Aug 13 09:07:24 2006
@@ -26,3 +26,4 @@
 #59_de_docroot.dpatch
 60_device_uri.dpatch
 61_job_c_strangeloop.dpatch
+62_classes_crash.dpatch

Added: cupsys/branches/cups-1.2/debian/patches/62_classes_crash.dpatch
==============================================================================
--- (empty file)
+++ cupsys/branches/cups-1.2/debian/patches/62_classes_crash.dpatch	Sun Aug 13 09:07:24 2006
@@ -0,0 +1,23 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 62_classes_crash.dpatch by Kenshi Muto <kmuto at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cupsys-1.2.2~/scheduler/classes.c cupsys-1.2.2/scheduler/classes.c
+--- cupsys-1.2.2~/scheduler/classes.c	2006-08-13 08:07:43.000000000 +0000
++++ cupsys-1.2.2/scheduler/classes.c	2006-08-13 08:56:01.000000000 +0000
+@@ -274,6 +274,12 @@
+   * Thanks to Joel Fredrikson for helping us get this right!
+   */
+ 
++  if (c->last_printer == 0)
++  {
++     cupsdLogMessage(CUPSD_LOG_ERROR, "Class \"%s\" hasn't any printers!", name);
++     return (NULL); /* strange, but there is no printer in class */
++  }
++
+   for (i = c->last_printer + 1; ; i ++)
+   {
+     if (i >= c->num_printers)



More information about the Pkg-cups-devel mailing list