#1119307 libpam-afs-session: fails to build on AFS enabled systems on Trixie and above

Package:
libpam-afs-session
Source:
libpam-afs-session
Description:
PAM module to set up a PAG and obtain AFS tokens
Submitter:
Christian Ospelkaus
Date:
2025-12-11 16:25:05 UTC
Severity:
normal
Tags:
#1119307#5
Date:
2025-10-29 05:53:04 UTC
From:
To:
Dear Maintainer,

the present package fails to build on an AFS enabled system. The reason
is an issue in the tests (in tests/) that are executed after the build.
Some of these tests are only run if a system that has AFS support. These
tests would obviously not be run on the Debian build infrastructure, and
therefore the issue did not show up so far. The issue is basically that
the tests set the username too late to properly check the behavior of
the PAM module. The patch below fixes this behavior. Kind regards,

Christian Ospelkaus


Description: fix tests to work on an AFS enabled system
Author: Christian Ospelkaus <christian.ospelkaus@iqo.uni-hannover.de>
Origin: other
--- a/tests/module/basic-t.c
+++ b/tests/module/basic-t.c
@@ -58,7 +58,6 @@
     config.extra[0] = aklog;

     /* Initial no-op tests. */
-    config.user = "testuser";
     run_script("data/scripts/basic/noop", &config);
     run_script("data/scripts/basic/noop-debug", &config);

@@ -67,6 +66,9 @@
      * creation of a PAG.
      */
     unlink("aklog-args");
+    config.user = user->pw_name;
+    basprintf(&uid, "%lu", (unsigned long) getuid());
+    config.extra[1] = uid;
     run_script("data/scripts/basic/no-ticket", &config);
     run_script("data/scripts/basic/no-ticket-debug", &config);
     ok(access("aklog-args", F_OK) < 0, "aklog was not run");