tags 885248 patch
thanks

On Mon, 2017-12-25 at 22:43 -0500, Aaron M. Ucko wrote:
> Source: syslog-ng
> Version: 3.13.2-1
> Severity: important
> Tags: upstream
> Justification: fails to build from source (but built successfully in
> the past)
> 
> Builds of syslog-ng for hurd-i386 (admittedly not a release
> architecture) have been failing lately:
> 
>              pathmax++;
>              ^~~~~~~

> It's great that directory-monitor.c already attempts to accommodate
> systems like the Hurd with no fixed PATH_MAX, but there are a couple
> of typos in the relevant code.  Please try removing the unbalanced
> (and unneeded) { on line 65 and fixing the spelling of path_max on
> line 87.

Attached is a patch fixing the PATH_MAX issue. In fact the whole
function get_path_max() is obsolete with the patch. For now it is
commented out.

Regarding the GNU/Hurd build one (1/70) test fails: 

FAIL: lib/logproto/tests/test_logproto
======================================

[2017-12-27T21:07:38.640000] Plugin module not found in 'module-path';
module-path='(null)', module='syslogformat'

Until the cause for module-path being null is found the build will not
succeed. However, the PATH_MAX issue is solved.
(A suspicion is that that a python module creates that empty module-
path. To be verified and solved.)

Thanks!
Index: syslog-ng-3.13.2/modules/affile/directory-monitor.c
===================================================================
--- syslog-ng-3.13.2.orig/modules/affile/directory-monitor.c
+++ syslog-ng-3.13.2/modules/affile/directory-monitor.c
@@ -51,6 +51,7 @@ build_filename(const gchar *basedir, con
   return result;
 }
 
+#if 0
 #define PATH_MAX_GUESS 1024
 
 static inline long
@@ -84,11 +85,12 @@ get_path_max(void)
          * the terminating null byte.  Same goes for XPG3.
          */
         if ((posix_version < 200112L) && (xsi_version < 4))
-          pathmax++;
+          path_max++;
 #endif
     }
   return path_max;
 }
+#endif
 
 /*
  Resolve . and ..
@@ -98,16 +100,14 @@ get_path_max(void)
 gchar *
 resolve_to_absolute_path(const gchar *path, const gchar *basedir)
 {
-  long path_max = get_path_max();
-  gchar *res;
+  gchar *res = NULL;
   gchar *w_name;
 
   w_name = build_filename(basedir, path);
-  res = (char *)g_malloc(path_max);
+  res = realpath(w_name, NULL);
 
-  if (!realpath(w_name, res))
+  if (res == NULL)
     {
-      g_free(res);
       if (errno == ENOENT)
         {
           res = g_strdup(path);

Reply via email to