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

Martin Pitt mpitt at costa.debian.org
Thu Apr 13 11:12:10 UTC 2006


Author: mpitt
Date: Thu Apr 13 11:12:09 2006
New Revision: 182

Added:
   cupsys/branches/cups-1.2/debian/patches/20_httpGetHostname_crash.dpatch   (contents, props changed)
Modified:
   cupsys/branches/cups-1.2/debian/changelog
   cupsys/branches/cups-1.2/debian/patches/00list
Log:
* debian/patches/20_httpGetHostname_crash.dpatch: Add some robustifications
  to httpGetHostname() to hopefully fix a reported crash.



Modified: cupsys/branches/cups-1.2/debian/changelog
==============================================================================
--- cupsys/branches/cups-1.2/debian/changelog	(original)
+++ cupsys/branches/cups-1.2/debian/changelog	Thu Apr 13 11:12:09 2006
@@ -84,8 +84,10 @@
   * debian/cupsys.logrotate: Use force-reload instead of reload, since the
     latter is not required to exist by Debian Policy.
   * debian/rules: Ship browsing_status and enable_browsing.
+  * debian/patches/20_httpGetHostname_crash.dpatch: Add some robustifications
+    to httpGetHostname() to hopefully fix a reported crash.
 
- -- Martin Pitt <mpitt at debian.org>  Wed, 12 Apr 2006 18:16:42 +0200
+ -- Martin Pitt <mpitt at debian.org>  Thu, 13 Apr 2006 13:08:54 +0200
 
 cupsys (1.1.99.b1.r4885-1) experimental; urgency=low
 

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	Thu Apr 13 11:12:09 2006
@@ -13,6 +13,7 @@
 12_quiesce_ipp_logging.dpatch
 13_default_log_warn.dpatch
 19_cupsaccept.dpatch
+20_httpGetHostname_crash.dpatch
 26_modprobe.dpatch
 44_fixconfdirperms.dpatch
 47_pid.dpatch

Added: cupsys/branches/cups-1.2/debian/patches/20_httpGetHostname_crash.dpatch
==============================================================================
--- (empty file)
+++ cupsys/branches/cups-1.2/debian/patches/20_httpGetHostname_crash.dpatch	Thu Apr 13 11:12:09 2006
@@ -0,0 +1,35 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 20_httpGetHostname_crash.dpatch by  <martin.pitt at ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad cups-1.2~/cups/http-addr.c cups-1.2/cups/http-addr.c
+--- cups-1.2~/cups/http-addr.c	2006-03-08 19:34:07.000000000 +0100
++++ cups-1.2/cups/http-addr.c	2006-04-13 13:07:32.000000000 +0200
+@@ -510,7 +510,7 @@
+ 
+   if (http)
+   {
+-    if (http->hostname[0] == '/')
++    if (!http->hostname || http->hostname[0] == '/')
+       strlcpy(s, "localhost", slen);
+     else
+       strlcpy(s, http->hostname, slen);
+@@ -521,9 +521,16 @@
+     * Get the hostname...
+     */
+ 
+-    gethostname(s, slen);
++    if (gethostname(s, slen) != 0)
++    {
++	/*
++	 * Fall back to localhost on failure
++	 */
++	strlcpy(s, "localhost", slen);
++	return (s);
++    }
+ 
+     if (!strchr(s, '.'))
+     {



More information about the Pkg-cups-devel mailing list