Package: release.debian.org
Severity: normal
User: [email protected]
Usertags: unblock

man-db (2.5.7-8) unstable; urgency=low

  * Avoid assertion if no path elements with manpaths were found (closes:
    #608490).

 -- Colin Watson <[email protected]>  Mon, 03 Jan 2011 01:13:19 +0000

This failure happens if you have "." on $PATH and try to build a package
whose upstream build system installs a manual page with executable
permissions.  This is not exactly common but I have my suspicions that
it is not entirely rare either, and I'd like to get this fixed to avoid
weird knock-on failures in builds elsewhere.

The patch is short enough that it follows here.

diff -Nru man-db-2.5.7/debian/changelog man-db-2.5.7/debian/changelog
--- man-db-2.5.7/debian/changelog       2010-12-04 13:39:40.000000000 +0000
+++ man-db-2.5.7/debian/changelog       2011-01-03 01:13:20.000000000 +0000
@@ -1,3 +1,10 @@
+man-db (2.5.7-8) unstable; urgency=low
+
+  * Avoid assertion if no path elements with manpaths were found (closes:
+    #608490).
+
+ -- Colin Watson <[email protected]>  Mon, 03 Jan 2011 01:13:19 +0000
+
 man-db (2.5.7-7) unstable; urgency=low
 
   * Backport from 2.5.8:
diff -Nru man-db-2.5.7/debian/patches/manpath-assertion.patch 
man-db-2.5.7/debian/patches/manpath-assertion.patch
--- man-db-2.5.7/debian/patches/manpath-assertion.patch 1970-01-01 
01:00:00.000000000 +0100
+++ man-db-2.5.7/debian/patches/manpath-assertion.patch 2011-01-03 
01:12:18.000000000 +0000
@@ -0,0 +1,53 @@
+Description: Avoid assertion if no path elements with manpaths were found
+Author: Colin Watson <[email protected]>
+Origin: backport, 
http://bazaar.launchpad.net/~cjwatson/man-db/trunk/revision/1300
+Bug-Debian: http://bugs.debian.org/608490
+Forwarded: not-needed
+Last-Update: 2011-01-03
+
+Index: b/src/man.c
+===================================================================
+--- a/src/man.c
++++ b/src/man.c
+@@ -921,8 +921,13 @@
+                               debug ("recalculating manpath for executable "
+                                      "in %s\n", argv_dir);
+ 
+-                              new_manp = locale_manpath (
+-                                      get_manpath_from_path (argv_dir, 0));
++                              new_manp = get_manpath_from_path (argv_dir, 0);
++                              if (!new_manp || !*new_manp) {
++                                      debug ("no useful manpath for "
++                                             "executable\n");
++                                      goto executable_out;
++                              }
++                              new_manp = locale_manpath (new_manp);
+ 
+                               old_manpathlist = XNMALLOC (MAXDIRS, char *);
+                               for (i = 0; i < MAXDIRS; ++i)
+@@ -936,6 +941,7 @@
+                                       manpathlist[i] = old_manpathlist[i];
+                               }
+                               free (old_manpathlist);
++executable_out:
+                               free (new_manp);
+                               free (argv_base);
+                       }
+Index: b/src/manp.c
+===================================================================
+--- a/src/manp.c
++++ b/src/manp.c
+@@ -1042,7 +1042,12 @@
+               lp++;
+       }
+ 
+-      assert (len);
++      if (!len)
++              /* No path elements in configuration file or with
++               * appropriate subdirectories.
++               */
++              return xstrdup ("");
++
+       manpathlist = xmalloc (len);
+       *manpathlist = '\0';
+ 
diff -Nru man-db-2.5.7/debian/patches/series man-db-2.5.7/debian/patches/series
--- man-db-2.5.7/debian/patches/series  2010-12-04 13:14:39.000000000 +0000
+++ man-db-2.5.7/debian/patches/series  2011-01-03 01:11:00.000000000 +0000
@@ -3,3 +3,4 @@
 translation-fr.patch
 translation-man-fr.patch
 locale-warnings.patch
+manpath-assertion.patch

Thanks,

-- 
Colin Watson                                       [[email protected]]



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Reply via email to