Your message dated Tue, 13 Mar 2012 02:48:06 +0000
with message-id <[email protected]>
and subject line Bug#638258: fixed in distcc 3.1-4.2
has caused the Debian Bug report #638258,
regarding distcc: FTBFS on hurd-i386 caused by reliance on PATH_MAX
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
638258: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=638258
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: distcc
Version: 3.1-4
Severity: normal
Tags: patch
User: [email protected]
Usertags: hurd

Hi,

Distcc fails to build on hurd-i386 because it relies on PATH_MAX being
defined. The attached patch (against the debian source) fixes this.

I also attach the standalone .dpatch file for your alternative
convenience.

-- 
Jeremie Koenig <[email protected]>
http://jk.fr.eu.org
commit ca56932b7c945bdd51d055228f66f205e49cfeb9
Author: Jeremie Koenig <[email protected]>
Date:   Wed Aug 17 22:13:59 2011 +0000

    * New patch 05_path_max fixes FTBFS on hurd-i386. Closes: #nnnnnn.

diff --git a/debian/patches/00list b/debian/patches/00list
index 2ff8924..9fef902 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -1,3 +1,4 @@
 02_distccmongnome_man
 03_do_not_install_redhat_config
 04_fix_pumps_include_server_path
+05_path_max
diff --git a/debian/patches/05_path_max.dpatch b/debian/patches/05_path_max.dpatch
new file mode 100644
index 0000000..a214c2f
--- /dev/null
+++ b/debian/patches/05_path_max.dpatch
@@ -0,0 +1,111 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 05_path_max.dpatch by Jeremie Koenig <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Don't rely on PATH_MAX being defined.
+
+@DPATCH@
+
+diff --git a/source/src/stringmap.c b/source/src/stringmap.c
+index 924e18c..aac2170 100644
+--- a/source/src/stringmap.c
++++ b/source/src/stringmap.c
+@@ -20,24 +20,28 @@
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <limits.h>
+ #include <assert.h>
+ #include "stringmap.h"
+ 
+ #ifndef NULL
+ #define NULL 0
+ #endif
+ 
++#ifndef PATH_MAX
++#define PATH_MAX 4096
++#endif
++
+ /* Load the given list of strings into the key/value map.
+  * The key for each string is the numFinalWordsToMatch of the string;
+  * the value for each string is the entire string.
+  * FIXME: doesn't work for utf-8 strings, since it scans raw chars for /
+  */
+ stringmap_t *stringmap_load(const char *filename, int numFinalWordsToMatch)
+ {
+     stringmap_t *result = calloc(1, sizeof(*result));
+     FILE *fp = fopen(filename, "r");
+     char buf[2*PATH_MAX];
+     int n;
+ 
+diff --git a/source/src/zeroconf.c b/source/src/zeroconf.c
+index 414ddc4..59f0dab 100644
+--- a/source/src/zeroconf.c
++++ b/source/src/zeroconf.c
+@@ -505,38 +505,43 @@ static int get_zeroconf_dir(char **dir_ret) {
+         *dir_ret = cached;
+         return 0;
+     } else {
+         ret = dcc_get_subdir("zeroconf", dir_ret);
+         if (ret == 0)
+             cached = *dir_ret;
+         return ret;
+     }
+ }
+ 
+ /* Get the host list from zeroconf */
+ int dcc_zeroconf_add_hosts(struct dcc_hostdef **ret_list, int *ret_nhosts, int n_slots, struct dcc_hostdef **ret_prev) {
+-    char host_file[PATH_MAX], lock_file[PATH_MAX], *s = NULL;
++    char *host_file = NULL, *lock_file = NULL, *s = NULL;
+     int lock_fd = -1, host_fd = -1;
+     int fork_daemon = 0;
+     int r = -1;
+     char *dir;
+     struct stat st;
+ 
+     if (get_zeroconf_dir(&dir) != 0) {
+         rs_log_crit("failed to get zeroconf dir.\n");
+         goto finish;
+     }
+ 
+-    snprintf(lock_file, sizeof(lock_file), "%s/lock", dir);
+-    snprintf(host_file, sizeof(host_file), "%s/hosts", dir);
++    lock_file = malloc(strlen(dir) + sizeof("/lock"));
++    assert(lock_file);
++    sprintf(lock_file, "%s/lock", dir);
++
++    host_file = malloc(strlen(dir) + sizeof("/hosts"));
++    assert(host_file);
++    sprintf(host_file, "%s/hosts", dir);
+ 
+     /* Open lock file */
+     if ((lock_fd = open(lock_file, O_RDWR|O_CREAT, 0666)) < 0) {
+         rs_log_crit("open('%s') failed: %s\n", lock_file, strerror(errno));
+         goto finish;
+     }
+ 
+     /* Try to lock the lock file */
+     if (generic_lock(lock_fd, 1, 1, 0) >= 0) {
+         /* The lock succeeded => there's no daemon running yet! */
+         fork_daemon = 1;
+         generic_lock(lock_fd, 1, 0, 0);
+@@ -621,16 +626,18 @@ int dcc_zeroconf_add_hosts(struct dcc_hostdef **ret_list, int *ret_nhosts, int n
+         rs_log_crit("failed to parse host file.\n");
+         goto finish;
+     }
+ 
+     r = 0;
+ 
+ finish:
+     if (host_fd >= 0) {
+         generic_lock(host_fd, 0, 0, 1);
+         close(host_fd);
+     }
+ 
++    free(lock_file);
++    free(host_file);
+     free(s);
+ 
+     return r;
+ }
#! /bin/sh /usr/share/dpatch/dpatch-run
## 05_path_max.dpatch by Jeremie Koenig <[email protected]>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Don't rely on PATH_MAX being defined.

@DPATCH@

diff --git a/source/src/stringmap.c b/source/src/stringmap.c
index 924e18c..aac2170 100644
--- a/source/src/stringmap.c
+++ b/source/src/stringmap.c
@@ -20,24 +20,28 @@
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <limits.h>
 #include <assert.h>
 #include "stringmap.h"
 
 #ifndef NULL
 #define NULL 0
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 /* Load the given list of strings into the key/value map.
  * The key for each string is the numFinalWordsToMatch of the string;
  * the value for each string is the entire string.
  * FIXME: doesn't work for utf-8 strings, since it scans raw chars for /
  */
 stringmap_t *stringmap_load(const char *filename, int numFinalWordsToMatch)
 {
     stringmap_t *result = calloc(1, sizeof(*result));
     FILE *fp = fopen(filename, "r");
     char buf[2*PATH_MAX];
     int n;
 
diff --git a/source/src/zeroconf.c b/source/src/zeroconf.c
index 414ddc4..59f0dab 100644
--- a/source/src/zeroconf.c
+++ b/source/src/zeroconf.c
@@ -505,38 +505,43 @@ static int get_zeroconf_dir(char **dir_ret) {
         *dir_ret = cached;
         return 0;
     } else {
         ret = dcc_get_subdir("zeroconf", dir_ret);
         if (ret == 0)
             cached = *dir_ret;
         return ret;
     }
 }
 
 /* Get the host list from zeroconf */
 int dcc_zeroconf_add_hosts(struct dcc_hostdef **ret_list, int *ret_nhosts, int 
n_slots, struct dcc_hostdef **ret_prev) {
-    char host_file[PATH_MAX], lock_file[PATH_MAX], *s = NULL;
+    char *host_file = NULL, *lock_file = NULL, *s = NULL;
     int lock_fd = -1, host_fd = -1;
     int fork_daemon = 0;
     int r = -1;
     char *dir;
     struct stat st;
 
     if (get_zeroconf_dir(&dir) != 0) {
         rs_log_crit("failed to get zeroconf dir.\n");
         goto finish;
     }
 
-    snprintf(lock_file, sizeof(lock_file), "%s/lock", dir);
-    snprintf(host_file, sizeof(host_file), "%s/hosts", dir);
+    lock_file = malloc(strlen(dir) + sizeof("/lock"));
+    assert(lock_file);
+    sprintf(lock_file, "%s/lock", dir);
+
+    host_file = malloc(strlen(dir) + sizeof("/hosts"));
+    assert(host_file);
+    sprintf(host_file, "%s/hosts", dir);
 
     /* Open lock file */
     if ((lock_fd = open(lock_file, O_RDWR|O_CREAT, 0666)) < 0) {
         rs_log_crit("open('%s') failed: %s\n", lock_file, strerror(errno));
         goto finish;
     }
 
     /* Try to lock the lock file */
     if (generic_lock(lock_fd, 1, 1, 0) >= 0) {
         /* The lock succeeded => there's no daemon running yet! */
         fork_daemon = 1;
         generic_lock(lock_fd, 1, 0, 0);
@@ -621,16 +626,18 @@ int dcc_zeroconf_add_hosts(struct dcc_hostdef **ret_list, 
int *ret_nhosts, int n
         rs_log_crit("failed to parse host file.\n");
         goto finish;
     }
 
     r = 0;
 
 finish:
     if (host_fd >= 0) {
         generic_lock(host_fd, 0, 0, 1);
         close(host_fd);
     }
 
+    free(lock_file);
+    free(host_file);
     free(s);
 
     return r;
 }

--- End Message ---
--- Begin Message ---
Source: distcc
Source-Version: 3.1-4.2

We believe that the bug you reported is fixed in the latest version of
distcc, which is due to be installed in the Debian FTP archive:

distcc-pump_3.1-4.2_amd64.deb
  to main/d/distcc/distcc-pump_3.1-4.2_amd64.deb
distcc_3.1-4.2.diff.gz
  to main/d/distcc/distcc_3.1-4.2.diff.gz
distcc_3.1-4.2.dsc
  to main/d/distcc/distcc_3.1-4.2.dsc
distcc_3.1-4.2_amd64.deb
  to main/d/distcc/distcc_3.1-4.2_amd64.deb
distccmon-gnome_3.1-4.2_amd64.deb
  to main/d/distcc/distccmon-gnome_3.1-4.2_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Hartwig <[email protected]> (supplier of updated distcc package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 12 Mar 2012 22:25:08 +0800
Source: distcc
Binary: distcc distccmon-gnome distcc-pump
Architecture: source amd64
Version: 3.1-4.2
Distribution: unstable
Urgency: low
Maintainer: Carsten Wolff <[email protected]>
Changed-By: Daniel Hartwig <[email protected]>
Description: 
 distcc     - Simple distributed compiler client and server
 distcc-pump - pump mode for distcc a distributed compiler client and server
 distccmon-gnome - GTK+ monitor for distcc a distributed client and server
Closes: 580308 638258
Changes: 
 distcc (3.1-4.2) unstable; urgency=low
 .
   * Non-maintainer upload.
   * Move distcc-pump python modules to private path (/usr/lib/distcc-pump)
     - 04_fix_pumps_include_server_path.dpatch: update for private path,
       removes hardcoded python version from path.  Closes: #580308
     - debian/rules: ensure PYTHON points to the default python version.
   * Fix FTBFS on hurd-i386 caused by reliance on PATH_MAX.
     Thanks to Jérémie Koenig for the patch.  Closes: #638258
Checksums-Sha1: 
 a7a0133eb600171d89a611a44f0f7d0a3b636cc1 1845 distcc_3.1-4.2.dsc
 3ff85221b219fa9950ec9ca377de47eb740bed5d 68167 distcc_3.1-4.2.diff.gz
 9e3217dddfef3170dc448494f8c35577bb0a5138 249530 distcc_3.1-4.2_amd64.deb
 ff01427cc8c65a6d8e879201c4b60bd8218466cd 45016 
distccmon-gnome_3.1-4.2_amd64.deb
 ee7e8ab7476b51c92d1f0a482ab616be8610926e 142230 distcc-pump_3.1-4.2_amd64.deb
Checksums-Sha256: 
 e6feeb980adb639d62aac4eed8d0570d251d75f1c7b993b889fc4bb047f06a66 1845 
distcc_3.1-4.2.dsc
 332c39e4256393772d4e8ddc584a53c629beeef3e835cbe6c7cc48c8cb29000b 68167 
distcc_3.1-4.2.diff.gz
 e43d0a2370fa71d4ef7b3109d139c133c642465cd5e82eaa5c41a12c0da5ae2b 249530 
distcc_3.1-4.2_amd64.deb
 2b5d5dc5537be6dd3b271a83f30b0875022bb09bbe31318efa0de59d0dc62a6c 45016 
distccmon-gnome_3.1-4.2_amd64.deb
 69f22eb4a649991108a07c2192c1e657a6f638be2e14472bcb59cd98abd9e292 142230 
distcc-pump_3.1-4.2_amd64.deb
Files: 
 59e4580641abfb63507d9d3d3bfa1528 1845 devel optional distcc_3.1-4.2.dsc
 27577cd42faa04d6b0c1ea2a13bfe7c9 68167 devel optional distcc_3.1-4.2.diff.gz
 a1574117f5055a46c7ef67ab74abbbfe 249530 devel optional distcc_3.1-4.2_amd64.deb
 01c9a51a718856f719534263523db838 45016 devel optional 
distccmon-gnome_3.1-4.2_amd64.deb
 0c15cb02619edc10cc108085e4f5f68c 142230 devel optional 
distcc-pump_3.1-4.2_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCgAGBQJPXqY2AAoJEDEWul6f+mmj+7gQAJaMIbLSgBCyOukT6WNRXwo5
lsZoU46mNU0kNcdYPCoXcMS2OnD/oc04XYS61fpSWvoAQnqYOC70z0fssc3T+HUJ
qsB8A+0ks3Ls6cf45YY4hbJYul0vExA/zI1r2WEE3LKjxtvd6vjZrC/2krp0/LKL
ztsNlBHj8uA0g7VzjFw7YPg+gVsYFfEKTJh5X1Gd7TPlKWJ8p39KcHfBK++Jmnlp
YQWflxXzXvTyII2KC6ObrHetQFoCLkPknxtIERBngZcNhnqktpOfVAFL2+Xsd+ME
bQrMLBwUIzhBwE/g0gxYCKKc9isSYgGSzonpNNdhmyU2iK6oeQedX0lHvaFLfrGR
X44pGfCedRZJzJWKKX/ALxgHQDJPI1YOtCDVvQ8UVhdEnq/OTF/cCf+IZboxKIkF
KW9Uy1zFKx1SFCtrXd6sHoweWOijQCYb1jPi+huwA+gOXaZqM8utNUrYGOBzRr9R
3ytXOftrPo2TTSMtTc1G7p1FWQlc4DGs54HZxhotrOu0+rxuxhJ6mo1KxfmtuWP+
qfHLvW28zRF2L6ltdIAT/SIBSaJHZryqPfpjgyEvWkNMyvUE6/DwmKovxNfy22d0
frlxHJzdF4Og4mtXLPMivxHTspcvMdq9834ShqLDceWT3abcHCOdHiZrlVlB/wRi
Lv+Mn2MDALZJ5CxWjzxD
=E/z8
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to