Package: pam
Version: 1.1.0-4
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd

Hi,

pam fails to build on GNU/Hurd because of a single test application
unconditionally using PATH_MAX.
The attached patch (hopefully trivial enough) fixes the problem and makes pam
buildable, including all successful test cases.

Thanks,
-- 
Pino
Index: pam-1.1.0/tests/tst-dlopen.c
===================================================================
--- pam-1.1.0.orig/tests/tst-dlopen.c
+++ pam-1.1.0/tests/tst-dlopen.c
@@ -15,6 +15,7 @@
 #include <stdio.h>
 #include <limits.h>
 #include <sys/stat.h>
+#include <string.h>
 
 /* Simple program to see if dlopen() would succeed. */
 int main(int argc, char **argv)
@@ -24,13 +25,14 @@
 #else
   int i;
   struct stat st;
-  char buf[PATH_MAX];
+  char *buf;
 
   for (i = 1; i < argc; i++) {
     if (dlopen(argv[i], RTLD_NOW)) {
       fprintf(stdout, "dlopen() of \"%s\" succeeded.\n",
               argv[i]);
     } else {
+      buf = malloc(strlen(argv[i]) + 3);
       snprintf(buf, sizeof(buf), "./%s", argv[i]);
       if ((stat(buf, &st) == 0) && dlopen(buf, RTLD_NOW)) {
         fprintf(stdout, "dlopen() of \"./%s\" "
@@ -38,8 +40,10 @@
       } else {
         fprintf(stdout, "dlopen() of \"%s\" failed: "
                 "%s\n", argv[i], dlerror());
+        free(buf);
         return 1;
       }
+      free(buf);
     }
   }
   return 0;

Reply via email to