Source: pam
Version: 1.7.0-5
Severity: important
Tags: ftbfs patch

Hello,

pam currently fails to build on hurd-any for a couple of upstream
reasons, and a debian reason. The attached patches fix them:

- hurd-fsuid fixes the usage of the linuxish setfsuid
- hurd-host-name-max comes from upstream, to fix a HOST_NAME_MAX use
- hurd-tcgeta fixes the usage of the non-posix TCGETA
- patch fixes the list of installed binaries according to what the
  upstream meson files build.

chmod +x debian/libpam-modules-bin.install

is then needed to make the packaging patch work.

With regards,
Samuel

-- System Information:
Debian Release: 13.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'testing-debug'), (500, 
'stable-security'), (500, 'stable-debug'), (500, 
'oldstable-proposed-updates-debug'), (500, 'oldoldstable'), (500, 
'buildd-unstable'), (500, 'unstable'), (500, 'stable'), (500, 'oldstable'), (1, 
'experimental-debug'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64

Kernel: Linux 6.15.0 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- 
Samuel
<y> update-menus: relocation error: update-menus: symbol 
_ZNSt9basic_iosIcSt11char_traitsIcEE4initEPSt15basic_streambufIcS1_E, version 
GLIBCPP_3.2 not defined in file libstdc++.so.5 with link time reference
<y> quoi que ça peut bien vouloir dire ?
<D> N a eu la meme merde
<y> c ça que ça veut dire ? wow, c'est bien crypté :)
 -+- #ens-mim s'entraide -+-
https://github.com/linux-pam/linux-pam/pull/917

diff --git a/libpam/pam_modutil_priv.c b/libpam/pam_modutil_priv.c
index a463e06a..456987ae 100644
--- a/libpam/pam_modutil_priv.c
+++ b/libpam/pam_modutil_priv.c
@@ -14,7 +14,9 @@
 #include <syslog.h>
 #include <pwd.h>
 #include <grp.h>
+#ifdef HAVE_SYS_FSUID_H
 #include <sys/fsuid.h>
+#endif /* HAVE_SYS_FSUID_H */
 
 /*
  * Two setfsuid() calls in a row are necessary to check
@@ -22,17 +24,35 @@
  */
 static int change_uid(uid_t uid, uid_t *save)
 {
+#ifdef HAVE_SYS_FSUID_H
        uid_t tmp = setfsuid(uid);
        if (save)
                *save = tmp;
        return (uid_t) setfsuid(uid) == uid ? 0 : -1;
+#else
+       uid_t tmp = geteuid();
+       if (save)
+               *save = tmp;
+       if (setresuid(-1, uid, tmp) < 0)
+               return -1;
+       return 0;
+#endif
 }
 static int change_gid(gid_t gid, gid_t *save)
 {
+#ifdef HAVE_SYS_FSUID_H
        gid_t tmp = setfsgid(gid);
        if (save)
                *save = tmp;
        return (gid_t) setfsgid(gid) == gid ? 0 : -1;
+#else
+       uid_t tmp = getegid();
+       if (save)
+               *save = tmp;
+       if (setresgid(-1, gid, tmp) < 0)
+               return -1;
+       return 0;
+#endif
 }
 
 static int cleanup(struct pam_modutil_privs *p)
diff --git a/meson.build b/meson.build
index 0827a53e..943bf8d5 100644
--- a/meson.build
+++ b/meson.build
@@ -164,6 +164,7 @@ check_headers = [
   'crypt.h',
   'paths.h',
   'sys/random.h',
+  'sys/fsuid.h',
 ]
 foreach h: check_headers
   if cc.has_header(h)
https://github.com/linux-pam/linux-pam/pull/909

commit 2311b4801401e567dffa4f70b6a9973b1762d8cd
Author: Pino Toscano <[email protected]>
Date:   Sun Jun 15 10:58:33 2025 +0200

    pam_xauth: provide fallback HOST_NAME_MAX
    
    Followup of commit 2e375aad04d047e12468f93300ad7e42a8a03ff3 for OSes
    that do not provide the optional HOST_NAME_MAX, in the same way as
    currently done in pam_echo.

diff --git a/modules/pam_xauth/pam_xauth.c b/modules/pam_xauth/pam_xauth.c
index f6419ced..b3ba5c49 100644
--- a/modules/pam_xauth/pam_xauth.c
+++ b/modules/pam_xauth/pam_xauth.c
@@ -83,6 +83,10 @@ static const char * const xauthpaths[] = {
        "/usr/bin/X11/xauth"
 };
 
+#ifndef HOST_NAME_MAX
+# define HOST_NAME_MAX 255
+#endif
+
 /* Run a given command (with a NULL-terminated argument list), feeding it the
  * given input on stdin, and storing any output it generates. */
 static int
https://github.com/linux-pam/linux-pam/pull/918

diff --git a/examples/tty_conv.c b/examples/tty_conv.c
index 59bbb3b3..e64e25f8 100644
--- a/examples/tty_conv.c
+++ b/examples/tty_conv.c
@@ -18,7 +18,7 @@
 static void echoOff(int fd, int off)
 {
     struct termios tty;
-    if (ioctl(fd, TCGETA, &tty) < 0)
+    if (tcgetattr(fd, &tty) < 0)
     {
         fprintf(stderr, "TCGETA failed: %s\n", strerror(errno));
         return;
@@ -27,7 +27,7 @@ static void echoOff(int fd, int off)
     if (off)
     {
         tty.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
-        if (ioctl(fd, TCSETAF, &tty) < 0)
+        if (tcsetattr(fd, 0, &tty) < 0)
         {
             fprintf(stderr, "TCSETAF failed: %s\n", strerror(errno));
         }
@@ -35,7 +35,7 @@ static void echoOff(int fd, int off)
     else
     {
         tty.c_lflag |= (ECHO | ECHOE | ECHOK | ECHONL);
-        if (ioctl(fd, TCSETAW, &tty) < 0)
+        if (tcsetattr(fd, TCSADRAIN, &tty) < 0)
         {
             fprintf(stderr, "TCSETAW failed: %s\n", strerror(errno));
         }
--- debian/libpam-modules-bin.install.original  2023-05-06 09:56:45.000000000 
+0000
+++ debian/libpam-modules-bin.install   2023-05-06 09:57:00.000000000 +0000
@@ -1,8 +1,9 @@
+#!/usr/bin/dh-exec
 usr/sbin/unix_chkpwd
-usr/sbin/unix_update
+[linux-any] usr/sbin/unix_update
 usr/sbin/mkhomedir_helper
-usr/sbin/pam_namespace_helper
+[linux-any] usr/sbin/pam_namespace_helper
 usr/sbin/pwhistory_helper
 usr/sbin/pam_timestamp_check
 usr/sbin/faillock
-usr/lib/systemd/system/pam_namespace.service
+[linux-any] usr/lib/systemd/system/pam_namespace.service

Reply via email to