Re: Bug#1029097:pam: FTBFS on hurd-i386

2024-04-11 Thread Svante Signell
On Thu, 2024-04-11 at 14:02 -0300, Diego Nieto Cid wrote:
> Hello
> 
> > --- /dev/null
> > +++ pam-1.5.3/libpam/include/path_max.h
> > @@ -0,0 +1,7 @@
> > +/*
> > + * Define PATH_MAX if not available
> > + */
> > +
> > +#ifndef PAH_MAX
> 
> There's a typo here ^ 
> 
> > +#define PATH_MAX 4096
> > +#endif
> 
> Cheers

Thanks,

New patch attached.

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 , Svante Signell 

Bug-Debian: http://bugs.debian.org/

Index: pam-1.5.3/libpam/include/path_max.h
===
--- /dev/null
+++ pam-1.5.3/libpam/include/path_max.h
@@ -0,0 +1,7 @@
+/*
+ * Define PATH_MAX if not available
+ */
+
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
Index: pam-1.5.3/tests/tst-dlopen.c
===
--- pam-1.5.3.orig/tests/tst-dlopen.c
+++ pam-1.5.3/tests/tst-dlopen.c
@@ -16,6 +16,9 @@
 #include 
 #include 
 
+/* Hurd compatibility */
+#include "path_max.h"
+
 /* Simple program to see if dlopen() would succeed. */
 int main(int argc, char **argv)
 {
Index: pam-1.5.3/modules/pam_debug/tst-pam_debug-retval.c
===
--- pam-1.5.3.orig/modules/pam_debug/tst-pam_debug-retval.c
+++ pam-1.5.3/modules/pam_debug/tst-pam_debug-retval.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_debug"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_deny/tst-pam_deny-retval.c
===
--- pam-1.5.3.orig/modules/pam_deny/tst-pam_deny-retval.c
+++ pam-1.5.3/modules/pam_deny/tst-pam_deny-retval.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_deny"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_echo/tst-pam_echo-retval.c
===
--- pam-1.5.3.orig/modules/pam_echo/tst-pam_echo-retval.c
+++ pam-1.5.3/modules/pam_echo/tst-pam_echo-retval.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_echo"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_faildelay/tst-pam_faildelay-retval.c
===
--- pam-1.5.3.orig/modules/pam_faildelay/tst-pam_faildelay-retval.c
+++ pam-1.5.3/modules/pam_faildelay/tst-pam_faildelay-retval.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_faildelay"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_localuser/tst-pam_localuser-retval.c
===
--- pam-1.5.3.orig/modules/pam_localuser/tst-pam_localuser-retval.c
+++ pam-1.5.3/modules/pam_localuser/tst-pam_localuser-retval.c
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_localuser"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c
===
--- pam-1.5.3.orig/modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c
+++ pam-1.5.3/modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_mkhomedir"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_nologin/tst-pam_nologin-retval.c
===
--- pam-1.5.3.orig/modules/pam_nologin/tst-pam_nologin-retval.c
+++ pam-1.5.3/modules/pam_nologin/tst-pam_nologin-retval.c
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_nologin"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_permit/tst-pam_permit-retval.c
===
--- pam-1.5.3.orig/modules/pam_permit/tst-pam_permit-retval.c
+++ pam-1.5.3/modules/pam_permit/tst-pam_permit-retval.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_permit"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_rootok/tst-pam_rootok-retval.c
===
--- pam-1.5.3.orig/modules/pam_rootok/tst-pam_rootok-retval.c
+++ pam-1.5.3/modules/pam_rootok/tst-pam_rootok-retval.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_rootok"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_warn/tst-pam_warn-retval.c

Re: Bug#1029097:pam: FTBFS on hurd-i386

2024-04-11 Thread Diego Nieto Cid
Hello

>--- /dev/null

>+++ pam-1.5.3/libpam/include/path_max.h
>@@ -0,0 +1,7 @@
>+/*
>+ * Define PATH_MAX if not available
>+ */
>+
>+#ifndef PAH_MAX


There's a typo here ^


>+#define PATH_MAX 4096
>+#endif


Cheers


Fwd: Bug#1029097:pam: FTBFS on hurd-i386

2024-04-11 Thread Svante Signell

--- Begin Message ---

Index: pam-1.5.3/modules/pam_nologin/tst-pam_nologin-retval.c
===
--- pam-1.5.3.orig/modules/pam_nologin/tst-pam_nologin-retval.c
+++ pam-1.5.3/modules/pam_nologin/tst-pam_nologin-retval.c
@@ -182,9 +182,17 @@ main(void)
 			  pam_start_confdir(service_file, pw->pw_name,
 	, ".", ));
 		ASSERT_NE(NULL, pamh);
+#ifndef __GNU__ /* This assertion fails on GNU/Hurd */
 		ASSERT_EQ(PAM_SYSTEM_ERR, pam_authenticate(pamh, 0));
+#else
+		ASSERT_EQ(PAM_PERM_DENIED, pam_authenticate(pamh, 0));
+#endif
 		ASSERT_EQ(PAM_PERM_DENIED, pam_setcred(pamh, 0));
+#ifndef __GNU__ /* This assertion fails on GNU/Hurd */
 		ASSERT_EQ(PAM_SYSTEM_ERR, pam_acct_mgmt(pamh, 0));
+#else
+		ASSERT_EQ(PAM_PERM_DENIED, pam_acct_mgmt(pamh, 0));
+#endif
 		ASSERT_EQ(PAM_MODULE_UNKNOWN, pam_chauthtok(pamh, 0));
 		ASSERT_EQ(PAM_MODULE_UNKNOWN, pam_open_session(pamh, 0));
 		ASSERT_EQ(PAM_MODULE_UNKNOWN, pam_close_session(pamh, 0));
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 , Svante Signell 

Bug-Debian: http://bugs.debian.org/

Index: pam-1.5.3/libpam/include/path_max.h
===
--- /dev/null
+++ pam-1.5.3/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.5.3/tests/tst-dlopen.c
===
--- pam-1.5.3.orig/tests/tst-dlopen.c
+++ pam-1.5.3/tests/tst-dlopen.c
@@ -16,6 +16,9 @@
 #include 
 #include 
 
+/* Hurd compatibility */
+#include "path_max.h"
+
 /* Simple program to see if dlopen() would succeed. */
 int main(int argc, char **argv)
 {
Index: pam-1.5.3/modules/pam_debug/tst-pam_debug-retval.c
===
--- pam-1.5.3.orig/modules/pam_debug/tst-pam_debug-retval.c
+++ pam-1.5.3/modules/pam_debug/tst-pam_debug-retval.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_debug"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_deny/tst-pam_deny-retval.c
===
--- pam-1.5.3.orig/modules/pam_deny/tst-pam_deny-retval.c
+++ pam-1.5.3/modules/pam_deny/tst-pam_deny-retval.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_deny"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_echo/tst-pam_echo-retval.c
===
--- pam-1.5.3.orig/modules/pam_echo/tst-pam_echo-retval.c
+++ pam-1.5.3/modules/pam_echo/tst-pam_echo-retval.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_echo"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_faildelay/tst-pam_faildelay-retval.c
===
--- pam-1.5.3.orig/modules/pam_faildelay/tst-pam_faildelay-retval.c
+++ pam-1.5.3/modules/pam_faildelay/tst-pam_faildelay-retval.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_faildelay"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_localuser/tst-pam_localuser-retval.c
===
--- pam-1.5.3.orig/modules/pam_localuser/tst-pam_localuser-retval.c
+++ pam-1.5.3/modules/pam_localuser/tst-pam_localuser-retval.c
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_localuser"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c
===
--- pam-1.5.3.orig/modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c
+++ pam-1.5.3/modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_mkhomedir"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_nologin/tst-pam_nologin-retval.c
===
--- pam-1.5.3.orig/modules/pam_nologin/tst-pam_nologin-retval.c
+++ pam-1.5.3/modules/pam_nologin/tst-pam_nologin-retval.c
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include "path_max.h"
 
 #define MODULE_NAME "pam_nologin"
 #define TEST_NAME "tst-" MODULE_NAME "-retval"
Index: pam-1.5.3/modules/pam_permit/tst-pam_permit-retval.c
===
--- pam-1.5.3.orig/modules/pam_permit/tst-pam_permit-retval.c
+++