[Pkg-cups-devel] r783 - in cupsys/trunk: . debian debian/patches

Martin Pitt mpitt at alioth.debian.org
Thu Jun 12 17:47:39 UTC 2008


Author: mpitt
Date: Thu Jun 12 17:47:39 2008
New Revision: 783

Log:
* Add empty_option_value_crash.dpatch: Fix crash on cupsd.conf options
  without a value. (Closes: #250848)

Added:
   cupsys/trunk/debian/patches/empty_option_value_crash.dpatch   (contents, props changed)
Modified:
   cupsys/trunk/   (props changed)
   cupsys/trunk/debian/changelog
   cupsys/trunk/debian/patches/00list

Modified: cupsys/trunk/debian/changelog
==============================================================================
--- cupsys/trunk/debian/changelog	(original)
+++ cupsys/trunk/debian/changelog	Thu Jun 12 17:47:39 2008
@@ -1,8 +1,10 @@
 cups (1.3.7-8) UNRELEASED; urgency=low
 
   * debian/cups.init.d: Restart xprint on start/stop/reload. (Closes: #285332)
+  * Add empty_option_value_crash.dpatch: Fix crash on cupsd.conf options
+    without a value. (Closes: #250848)
 
- -- Martin Pitt <mpitt at debian.org>  Tue, 10 Jun 2008 21:46:49 +0200
+ -- Martin Pitt <mpitt at debian.org>  Wed, 11 Jun 2008 11:20:55 +0200
 
 cups (1.3.7-7) unstable; urgency=low
 

Modified: cupsys/trunk/debian/patches/00list
==============================================================================
--- cupsys/trunk/debian/patches/00list	(original)
+++ cupsys/trunk/debian/patches/00list	Thu Jun 12 17:47:39 2008
@@ -1,4 +1,10 @@
+# patches taken from upstream SVN:
+empty_option_value_crash.dpatch
 CVE-2008-1722.dpatch
+pdftops-cups-1.4.dpatch
+pdftops-dont_fail_on_cancel.dpatch
+
+# Debian patches
 freebsd.dpatch
 removecvstag.dpatch
 quiesce_ipp_logging.dpatch
@@ -12,8 +18,8 @@
 reactivate_recommended_driver.dpatch
 include_krb5_h_in_job_h.dpatch
 search_mime_files_in_usr_share.dpatch
-pdftops-cups-1.4.dpatch
-pdftops-dont_fail_on_cancel.dpatch
 ppd-poll-with-client-conf.dpatch
+
+# Ubuntu patches
 ubuntu-disable-browsing.dpatch
 ubuntu-default-error-policy-retry-job.dpatch

Added: cupsys/trunk/debian/patches/empty_option_value_crash.dpatch
==============================================================================
--- (empty file)
+++ cupsys/trunk/debian/patches/empty_option_value_crash.dpatch	Thu Jun 12 17:47:39 2008
@@ -0,0 +1,308 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 00upstream-empty_option_value_crash.dpatch by  <mpitt at debian.org>
+##
+## DP: STR#2849, Debian #250848: Fix crash with empty option values.
+
+ at DPATCH@
+diff -urNad trunk~/scheduler/conf.c trunk/scheduler/conf.c
+--- trunk~/scheduler/conf.c	2008-06-10 22:15:22.000000000 +0200
++++ trunk/scheduler/conf.c	2008-06-11 11:16:30.000000000 +0200
+@@ -2088,7 +2088,7 @@
+     * Decode the directive...
+     */
+ 
+-    if (!strcasecmp(line, "Include"))
++    if (!strcasecmp(line, "Include") && value)
+     {
+      /*
+       * Include filename
+@@ -2109,72 +2109,39 @@
+ 	cupsFileClose(incfile);
+       }
+     }
+-    else if (!strcasecmp(line, "<Location"))
++    else if (!strcasecmp(line, "<Location") && value)
+     {
+      /*
+       * <Location path>
+       */
+ 
+-      if (value)
+-      {
+-	linenum = read_location(fp, value, linenum);
+-	if (linenum == 0)
+-	  return (0);
+-      }
+-      else
+-      {
+-        cupsdLogMessage(CUPSD_LOG_ERROR, "Syntax error on line %d.",
+-	           linenum);
+-        return (0);
+-      }
++      linenum = read_location(fp, value, linenum);
++      if (linenum == 0)
++	return (0);
+     }
+-    else if (!strcasecmp(line, "<Policy"))
++    else if (!strcasecmp(line, "<Policy") && value)
+     {
+      /*
+       * <Policy name>
+       */
+ 
+-      if (value)
+-      {
+-	linenum = read_policy(fp, value, linenum);
+-	if (linenum == 0)
+-	  return (0);
+-      }
+-      else
+-      {
+-        cupsdLogMessage(CUPSD_LOG_ERROR, "Syntax error on line %d.", linenum);
+-        return (0);
+-      }
++      linenum = read_policy(fp, value, linenum);
++      if (linenum == 0)
++	return (0);
+     }
+-    else if (!strcasecmp(line, "FaxRetryInterval"))
++    else if (!strcasecmp(line, "FaxRetryInterval") && value)
+     {
+-      if (value)
+-      {
+-        JobRetryInterval = atoi(value);
+-	cupsdLogMessage(CUPSD_LOG_WARN,
+-	                "FaxRetryInterval is deprecated; use "
+-			"JobRetryInterval on line %d.", linenum);
+-      }
+-      else
+-      {
+-        cupsdLogMessage(CUPSD_LOG_ERROR, "Syntax error on line %d.", linenum);
+-        return (0);
+-      }
++      JobRetryInterval = atoi(value);
++      cupsdLogMessage(CUPSD_LOG_WARN,
++		      "FaxRetryInterval is deprecated; use "
++		      "JobRetryInterval on line %d.", linenum);
+     }
+-    else if (!strcasecmp(line, "FaxRetryLimit"))
++    else if (!strcasecmp(line, "FaxRetryLimit") && value)
+     {
+-      if (value)
+-      {
+-        JobRetryLimit = atoi(value);
+-	cupsdLogMessage(CUPSD_LOG_WARN,
+-	                "FaxRetryLimit is deprecated; use "
+-			"JobRetryLimit on line %d.", linenum);
+-      }
+-      else
+-      {
+-        cupsdLogMessage(CUPSD_LOG_ERROR, "Syntax error on line %d.", linenum);
+-        return (0);
+-      }
++      JobRetryLimit = atoi(value);
++      cupsdLogMessage(CUPSD_LOG_WARN,
++		      "FaxRetryLimit is deprecated; use "
++		      "JobRetryLimit on line %d.", linenum);
+     }
+     else if (!strcasecmp(line, "Port") || !strcasecmp(line, "Listen")
+ #ifdef HAVE_SSL
+@@ -2268,7 +2235,7 @@
+ 
+       httpAddrFreeList(addrlist);
+     }
+-    else if (!strcasecmp(line, "BrowseAddress"))
++    else if (!strcasecmp(line, "BrowseAddress") && value)
+     {
+      /*
+       * Add a browse address to the list...
+@@ -2349,7 +2316,7 @@
+         cupsdLogMessage(CUPSD_LOG_ERROR, "Bad BrowseAddress %s at line %d.",
+ 	                value, linenum);
+     }
+-    else if (!strcasecmp(line, "BrowseOrder"))
++    else if (!strcasecmp(line, "BrowseOrder") && value)
+     {
+      /*
+       * "BrowseOrder Deny,Allow" or "BrowseOrder Allow,Deny"...
+@@ -2395,8 +2362,8 @@
+       if (strcasecmp(line, "BrowseRemoteProtocols"))
+         BrowseLocalProtocols = protocols;
+     }
+-    else if (!strcasecmp(line, "BrowseAllow") ||
+-             !strcasecmp(line, "BrowseDeny"))
++    else if ((!strcasecmp(line, "BrowseAllow") ||
++              !strcasecmp(line, "BrowseDeny")) && value)
+     {
+      /*
+       * BrowseAllow [From] host/ip...
+@@ -2500,7 +2467,7 @@
+ 	}
+       }
+     }
+-    else if (!strcasecmp(line, "BrowseRelay"))
++    else if (!strcasecmp(line, "BrowseRelay") && value)
+     {
+      /*
+       * BrowseRelay [from] source [to] destination
+@@ -2676,7 +2643,7 @@
+ 	                value, linenum);
+       }
+     }
+-    else if (!strcasecmp(line, "BrowsePoll"))
++    else if (!strcasecmp(line, "BrowsePoll") && value)
+     {
+      /*
+       * BrowsePoll address[:port]
+@@ -2738,7 +2705,7 @@
+       cupsdLogMessage(CUPSD_LOG_INFO, "Polling %s:%d", pollp->hostname,
+ 	              pollp->port);
+     }
+-    else if (!strcasecmp(line, "DefaultAuthType"))
++    else if (!strcasecmp(line, "DefaultAuthType") && value)
+     {
+      /*
+       * DefaultAuthType {basic,digest,basicdigest,negotiate}
+@@ -2787,7 +2754,7 @@
+     }
+ #endif /* HAVE_SSL */
+ #ifdef HAVE_GSSAPI
+-    else if (!strcasecmp(line, "Krb5Keytab"))
++    else if (!strcasecmp(line, "Krb5Keytab") && value)
+     {
+       cupsdSetStringf(&Krb5Keytab, "KRB5_KTNAME=%s", value);
+       putenv(Krb5Keytab);
+@@ -2799,13 +2766,13 @@
+ #  endif /* HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY */
+     }
+ #endif /* HAVE_GSSAPI */
+-    else if (!strcasecmp(line, "User"))
++    else if (!strcasecmp(line, "User") && value)
+     {
+      /*
+       * User ID to run as...
+       */
+ 
+-      if (value && isdigit(value[0] & 255))
++      if (isdigit(value[0] & 255))
+       {
+         int uid = atoi(value);
+ 
+@@ -2818,7 +2785,7 @@
+         else
+ 	  User = atoi(value);
+       }
+-      else if (value)
++      else
+       {
+         struct passwd *p;	/* Password information */
+ 
+@@ -2841,12 +2808,8 @@
+ 	                  "Unknown User \"%s\" on line %d, ignoring!",
+ 	                  value, linenum);
+       }
+-      else
+-	cupsdLogMessage(CUPSD_LOG_ERROR,
+-	                "User directive on line %d missing the username!",
+-	                linenum);
+     }
+-    else if (!strcasecmp(line, "Group"))
++    else if (!strcasecmp(line, "Group") && value)
+     {
+      /*
+       * Group ID to run as...
+@@ -2867,7 +2830,7 @@
+ 	                  value, linenum);
+       }
+     }
+-    else if (!strcasecmp(line, "SystemGroup"))
++    else if (!strcasecmp(line, "SystemGroup") && value)
+     {
+      /*
+       * SystemGroup (admin) group(s)...
+@@ -2878,7 +2841,7 @@
+ 	                "Unknown SystemGroup \"%s\" on line %d, ignoring!",
+ 	                value, linenum);
+     }
+-    else if (!strcasecmp(line, "HostNameLookups"))
++    else if (!strcasecmp(line, "HostNameLookups") && value)
+     {
+      /*
+       * Do hostname lookups?
+@@ -2894,7 +2857,7 @@
+ 	cupsdLogMessage(CUPSD_LOG_WARN, "Unknown HostNameLookups %s on line %d.",
+ 	                value, linenum);
+     }
+-    else if (!strcasecmp(line, "LogLevel"))
++    else if (!strcasecmp(line, "LogLevel") && value)
+     {
+      /*
+       * Amount of logging to do...
+@@ -2924,7 +2887,7 @@
+         cupsdLogMessage(CUPSD_LOG_WARN, "Unknown LogLevel %s on line %d.",
+ 	                value, linenum);
+     }
+-    else if (!strcasecmp(line, "PrintcapFormat"))
++    else if (!strcasecmp(line, "PrintcapFormat") && value)
+     {
+      /*
+       * Format of printcap file?
+@@ -2938,7 +2901,7 @@
+ 	cupsdLogMessage(CUPSD_LOG_WARN, "Unknown PrintcapFormat %s on line %d.",
+ 	                value, linenum);
+     }
+-    else if (!strcasecmp(line, "ServerTokens"))
++    else if (!strcasecmp(line, "ServerTokens") && value)
+     {
+      /*
+       * Set the string used for the Server header...
+@@ -2968,7 +2931,7 @@
+ 	cupsdLogMessage(CUPSD_LOG_WARN, "Unknown ServerTokens %s on line %d.",
+                         value, linenum);
+     }
+-    else if (!strcasecmp(line, "PassEnv"))
++    else if (!strcasecmp(line, "PassEnv") && value)
+     {
+      /*
+       * PassEnv variable [... variable]
+@@ -2993,7 +2956,7 @@
+ 	    break;
+       }
+     }
+-    else if (!strcasecmp(line, "SetEnv"))
++    else if (!strcasecmp(line, "SetEnv") && value)
+     {
+      /*
+       * SetEnv variable value
+@@ -3033,8 +2996,12 @@
+         * Unknown directive!  Output an error message and continue...
+ 	*/
+ 
+-        cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown directive %s on line %d.",
+-	                line, linenum);
++        if (!value)
++	  cupsdLogMessage(CUPSD_LOG_ERROR, "Missing value for %s on line %d.",
++	                  line, linenum);
++	else
++	  cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown directive %s on line %d.",
++	                  line, linenum);
+         continue;
+       }
+ 
+@@ -3098,7 +3065,15 @@
+ 	    break;
+ 
+ 	case CUPSD_VARTYPE_PATHNAME :
+-            if (value[0] == '/')
++            if (!value)
++	    {
++	      cupsdLogMessage(CUPSD_LOG_ERROR,
++	                      "Missing pathname value for %s on line %d!",
++			      line, linenum);
++              break;
++	    }
++
++	    if (value[0] == '/')
+ 	      strlcpy(temp, value, sizeof(temp));
+ 	    else
+ 	      snprintf(temp, sizeof(temp), "%s/%s", ServerRoot, value);



More information about the Pkg-cups-devel mailing list