--- Begin Message ---
Source: pam
Version: 1.5.2-6
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd
X-Debbugs-CC: debian-h...@lists.debian.org
Hi,
pam FTBFS on hurd-i386 (built in the past, last successful build was
1.4.0-10).
Attached are four files:
- no_PATH_MAX_on_hurd rewritten to cope with that many tests use
PATH_MAX.
- modules_pam_limits_pam_limits.c.diff embedding code with #ifdef
__linux__ that only works on Linux.
- modules_pam_nologin_tst-pam_nologin-retval.c.diff disabling two
subtests failing on GNU/Hurd.
- debian_libpam-modules-bin.install.hurd-i386.patch creating an install
file for Hurd excluding two systemd-specific files not needed.
Thanks!
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 <vor...@debian.org>, Svante Signell
<svante.sign...@gmail.com>
Bug-Debian: http://bugs.debian.org/<tbd>
Index: pam-1.5.2/libpam/include/path_max.h
===================================================================
--- /dev/null
+++ pam-1.5.2/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.2/tests/tst-dlopen.c
===================================================================
--- pam-1.5.2.orig/tests/tst-dlopen.c
+++ pam-1.5.2/tests/tst-dlopen.c
@@ -16,6 +16,9 @@
#include <limits.h>
#include <sys/stat.h>
+/* Hurd compatibility */
+#include "path_max.h"
+
/* Simple program to see if dlopen() would succeed. */
int main(int argc, char **argv)
{
Index: pam-1.5.2/modules/pam_debug/tst-pam_debug-retval.c
===================================================================
--- pam-1.5.2.orig/modules/pam_debug/tst-pam_debug-retval.c
+++ pam-1.5.2/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.5.2/modules/pam_deny/tst-pam_deny-retval.c
===================================================================
--- pam-1.5.2.orig/modules/pam_deny/tst-pam_deny-retval.c
+++ pam-1.5.2/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.5.2/modules/pam_echo/tst-pam_echo-retval.c
===================================================================
--- pam-1.5.2.orig/modules/pam_echo/tst-pam_echo-retval.c
+++ pam-1.5.2/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.5.2/modules/pam_faildelay/tst-pam_faildelay-retval.c
===================================================================
--- pam-1.5.2.orig/modules/pam_faildelay/tst-pam_faildelay-retval.c
+++ pam-1.5.2/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.5.2/modules/pam_localuser/tst-pam_localuser-retval.c
===================================================================
--- pam-1.5.2.orig/modules/pam_localuser/tst-pam_localuser-retval.c
+++ pam-1.5.2/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.5.2/modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c
===================================================================
--- pam-1.5.2.orig/modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c
+++ pam-1.5.2/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.5.2/modules/pam_nologin/tst-pam_nologin-retval.c
===================================================================
--- pam-1.5.2.orig/modules/pam_nologin/tst-pam_nologin-retval.c
+++ pam-1.5.2/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.5.2/modules/pam_permit/tst-pam_permit-retval.c
===================================================================
--- pam-1.5.2.orig/modules/pam_permit/tst-pam_permit-retval.c
+++ pam-1.5.2/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.5.2/modules/pam_rootok/tst-pam_rootok-retval.c
===================================================================
--- pam-1.5.2.orig/modules/pam_rootok/tst-pam_rootok-retval.c
+++ pam-1.5.2/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.5.2/modules/pam_warn/tst-pam_warn-retval.c
===================================================================
--- pam-1.5.2.orig/modules/pam_warn/tst-pam_warn-retval.c
+++ pam-1.5.2/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.5.2/modules/pam_nologin/tst-pam_nologin-retval.c
===================================================================
--- pam-1.5.2.orig/modules/pam_nologin/tst-pam_nologin-retval.c
+++ pam-1.5.2/modules/pam_nologin/tst-pam_nologin-retval.c
@@ -182,9 +182,13 @@ main(void)
pam_start_confdir(service_file, pw->pw_name,
&conv, ".", &pamh));
ASSERT_NE(NULL, pamh);
+#ifndef __GNU__ /* This test fails on GNU/Hurd, reason unknown */
ASSERT_EQ(PAM_SYSTEM_ERR, pam_authenticate(pamh, 0));
+#endif
ASSERT_EQ(PAM_PERM_DENIED, pam_setcred(pamh, 0));
+#ifndef __GNU__ /* This test fails on GNU/Hurd, reason unknown */
ASSERT_EQ(PAM_SYSTEM_ERR, 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));
Index: pam-1.5.2/modules/pam_limits/pam_limits.c
===================================================================
--- pam-1.5.2.orig/modules/pam_limits/pam_limits.c
+++ pam-1.5.2/modules/pam_limits/pam_limits.c
@@ -28,7 +28,9 @@
#include <syslog.h>
#include <stdarg.h>
#include <signal.h>
+#ifdef __linux__
#include <sys/prctl.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/resource.h>
@@ -392,6 +394,7 @@ static rlim_t str2rlim_t(char *value) {
item = line + pos + 1; \
}
+#ifdef __linux__
static void parse_kernel_limits(pam_handle_t *pamh, struct pam_limit_s *pl, int ctrl)
{
int i, maxlen = 0;
@@ -460,6 +463,7 @@ static void parse_kernel_limits(pam_hand
pl->limits[RLIMIT_NOFILE].limit.rlim_cur = FD_SETSIZE;
}
}
+#endif
static int init_limits(pam_handle_t *pamh, struct pam_limit_s *pl, int ctrl)
{
@@ -1163,10 +1167,12 @@ static int setup_limits(pam_handle_t *pa
}
if (pl->nonewprivs) {
+#ifdef __linux__
if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) < 0) {
pam_syslog(pamh, LOG_ERR, "Could not set prctl(PR_SET_NO_NEW_PRIVS): %m");
retval |= LIMIT_ERR;
}
+#endif
}
if (!retval && pl->chroot_dir[0]) {
--- /dev/null 2023-01-16 15:30:04.000000000 +0100
+++ b/debian/libpam-modules-bin.install.hurd-i386 2023-01-16 15:53:07.000000000 +0100
@@ -0,0 +1,7 @@
+sbin/unix_chkpwd sbin
+sbin/unix_update sbin
+sbin/mkhomedir_helper sbin
+sbin/pwhistory_helper
+sbin/pam_timestamp_check usr/sbin
+sbin/faillock usr/sbin
+modules/pam_faillock/faillock.8 usr/share/man/man8
--- End Message ---