Description: define PATH_MAX for compatibility when it's not already set
 Some platforms, such as the Hurd, don't set PATH_MAX.  Set a reasonable
 default value in this case.
Authors: Steve Langasek <vorlon@debian.org>, Svante Signell <svante.signell@gmail.com>
Bug-Debian: http://bugs.debian.org/<tbd>

Index: pam-1.7.0/libpam/include/path_max.h
===================================================================
--- /dev/null
+++ pam-1.7.0/libpam/include/path_max.h
@@ -0,0 +1,7 @@
+/*
+ * Define PATH_MAX if not available
+ */
+
+#ifndef PAH_MAX
+#define PATH_MAX 4096
+#endif
Index: pam-1.7.0/modules/pam_debug/tst-pam_debug-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_debug/tst-pam_debug-retval.c
+++ pam-1.7.0/modules/pam_debug/tst-pam_debug-retval.c
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_debug"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_deny/tst-pam_deny-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_deny/tst-pam_deny-retval.c
+++ pam-1.7.0/modules/pam_deny/tst-pam_deny-retval.c
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_deny"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_echo/tst-pam_echo-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_echo/tst-pam_echo-retval.c
+++ pam-1.7.0/modules/pam_echo/tst-pam_echo-retval.c
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_echo"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_faildelay/tst-pam_faildelay-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_faildelay/tst-pam_faildelay-retval.c
+++ pam-1.7.0/modules/pam_faildelay/tst-pam_faildelay-retval.c
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_faildelay"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_localuser/tst-pam_localuser-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_localuser/tst-pam_localuser-retval.c
+++ pam-1.7.0/modules/pam_localuser/tst-pam_localuser-retval.c
@@ -12,6 +12,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_localuser"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c
+++ pam-1.7.0/modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c
@@ -14,6 +14,7 @@
 #include <pwd.h>
 #include <sys/stat.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_mkhomedir"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_nologin/tst-pam_nologin-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_nologin/tst-pam_nologin-retval.c
+++ pam-1.7.0/modules/pam_nologin/tst-pam_nologin-retval.c
@@ -12,6 +12,7 @@
 #include <unistd.h>
 #include <pwd.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_nologin"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_permit/tst-pam_permit-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_permit/tst-pam_permit-retval.c
+++ pam-1.7.0/modules/pam_permit/tst-pam_permit-retval.c
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_permit"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_rootok/tst-pam_rootok-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_rootok/tst-pam_rootok-retval.c
+++ pam-1.7.0/modules/pam_rootok/tst-pam_rootok-retval.c
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_rootok"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_warn/tst-pam_warn-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_warn/tst-pam_warn-retval.c
+++ pam-1.7.0/modules/pam_warn/tst-pam_warn-retval.c
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_warn"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_env/tst-pam_env-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_env/tst-pam_env-retval.c
+++ pam-1.7.0/modules/pam_env/tst-pam_env-retval.c
@@ -16,6 +16,7 @@
 #include <unistd.h>
 #include <sys/stat.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_env"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_faillock/tst-pam_faillock-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_faillock/tst-pam_faillock-retval.c
+++ pam-1.7.0/modules/pam_faillock/tst-pam_faillock-retval.c
@@ -9,6 +9,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_faillock"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_pwhistory/tst-pam_pwhistory-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_pwhistory/tst-pam_pwhistory-retval.c
+++ pam-1.7.0/modules/pam_pwhistory/tst-pam_pwhistory-retval.c
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_pwhistory"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.7.0/modules/pam_time/tst-pam_time-retval.c
===================================================================
--- pam-1.7.0.orig/modules/pam_time/tst-pam_time-retval.c
+++ pam-1.7.0/modules/pam_time/tst-pam_time-retval.c
@@ -12,6 +12,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <security/pam_appl.h>
+#include "path_max.h"
 
 #define MODULE_NAME "pam_time"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
