View Issue Details

IDProjectCategoryView StatusLast Update
0004054GNUnettestbed servicepublic2018-06-07 00:24
ReporterbeberkingAssigned ToChristian Grothoff 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformOSGNU/HurdOS Version
Product Version0.10.1 
Target Version0.11.0pre66Fixed in Version0.11.0pre66 
Summary0004054: Gnunet fails to build on GNU/Hurd
DescriptionGNUnet fails to build on GNU/Hurd, because the PATH_MAX macro is not defined on this OS [1].

[1] https://www.gnu.org/software/hurd/community/gsoc/project_ideas/maxpath.html
Additional InformationA patch written by Svante Signell <svante.signell@gmail.com> [2] is attached. Please make sure it is right before including it into GNUnet.
TagsNo tags attached.

Activities

beberking

2015-11-15 16:20

developer  

path_max.patch (3,053 bytes)
Index: gnunet-0.10.1/src/testbed/gnunet-daemon-testbed-blacklist.c
===================================================================
--- gnunet-0.10.1.orig/src/testbed/gnunet-daemon-testbed-blacklist.c
+++ gnunet-0.10.1/src/testbed/gnunet-daemon-testbed-blacklist.c
@@ -212,7 +212,7 @@ run (void *cls, char *const *args, const
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
   char *shome;
-  char fname[PATH_MAX];
+  char *fname = NULL;
 
   if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (c, "PATHS",
                                                             "GNUNET_HOME",
@@ -221,7 +221,10 @@ run (void *cls, char *const *args, const
     GNUNET_break (0);
     return;
   }
-  GNUNET_assert (0 < GNUNET_snprintf (fname, PATH_MAX, "%s/whitelist", shome));
+  int len = strlen(shome) + 10 + 1;
+
+  fname = GNUNET_malloc (len);
+  GNUNET_assert (0 < GNUNET_snprintf (fname, len, "%s/whitelist", shome));
   if (GNUNET_YES == GNUNET_DISK_file_test (fname))
   {
     mode = ACCESS_ALLOW;
@@ -229,12 +232,13 @@ run (void *cls, char *const *args, const
     GNUNET_free (shome);
     return;
   }
-  GNUNET_assert (0 < GNUNET_snprintf (fname, PATH_MAX, "%s/blacklist", shome));
+  GNUNET_assert (0 < GNUNET_snprintf (fname, len, "%s/blacklist", shome));
   if (GNUNET_YES == GNUNET_DISK_file_test (fname))
   {
     mode = ACCESS_DENY;
     setup_ac (shome, c);
   }
+  GNUNET_free (fname);
   GNUNET_free (shome);
   return;
 }
Index: gnunet-0.10.1/src/testbed/gnunet-helper-testbed.c
===================================================================
--- gnunet-0.10.1.orig/src/testbed/gnunet-helper-testbed.c
+++ gnunet-0.10.1/src/testbed/gnunet-helper-testbed.c
@@ -422,12 +422,15 @@ tokenizer_cb (void *cls, void *client,
 #ifdef WINDOWS
     GNUNET_assert (0 != SetEnvironmentVariable (GNUNET_TESTING_PREFIX, evstr));
 #else
-    static char evar[2* PATH_MAX];
+    static char *evar = NULL;
+    int len = strlen(GNUNET_TESTING_PREFIX) + 1 + strlen(evstr) + 1;
 
-    GNUNET_assert (0 < GNUNET_snprintf (evar, sizeof (evar),
+    evar = GNUNET_malloc (len);
+    GNUNET_assert (0 < GNUNET_snprintf (evar, len,
                                         GNUNET_TESTING_PREFIX "=%s", evstr));
     putenv (evar);
 #endif
+    GNUNET_free (evar);
     GNUNET_free (evstr);
     evstr = NULL;
   }
@@ -451,12 +454,16 @@ tokenizer_cb (void *cls, void *client,
   LOG_DEBUG ("Staring testbed with config: %s\n", config);
   binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-testbed");
   {
-    static char evar[2 * PATH_MAX];
+    static char *evar = NULL;
+    int len = strlen(ENV_TESTBED_CONFIG) + 1 + strlen(config) + 1;
+
+    evar = GNUNET_malloc (len);
 
     /* expose testbed configuration through env variable */
-    GNUNET_assert (0 < GNUNET_snprintf (evar, sizeof (evar),
+    GNUNET_assert (0 < GNUNET_snprintf (evar, len,
                                         "%s=%s", ENV_TESTBED_CONFIG, config));
     GNUNET_assert (0 == putenv (evar));
+    GNUNET_free (evar);
     evstr = NULL;
   }
   testbed =
path_max.patch (3,053 bytes)

Christian Grothoff

2015-11-16 08:43

manager   ~0009903

Fixed (but differently from original patch) in SVN 36664.

Issue History

Date Modified Username Field Change
2015-11-15 16:20 beberking New Issue
2015-11-15 16:20 beberking Status new => assigned
2015-11-15 16:20 beberking Assigned To => Sree Harsha Totakura
2015-11-15 16:20 beberking File Added: path_max.patch
2015-11-16 08:37 Christian Grothoff Assigned To Sree Harsha Totakura => Christian Grothoff
2015-11-16 08:43 Christian Grothoff Note Added: 0009903
2015-11-16 08:43 Christian Grothoff Status assigned => resolved
2015-11-16 08:43 Christian Grothoff Fixed in Version => 0.11.0pre66
2015-11-16 08:43 Christian Grothoff Resolution open => fixed
2015-11-16 08:43 Christian Grothoff Product Version => 0.10.1
2015-11-16 08:43 Christian Grothoff Target Version => 0.11.0pre66
2018-06-07 00:24 Christian Grothoff Status resolved => closed