OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_2-327-g863cfd1
Gerrit Code Review
gerrit@openafs.org
Tue, 21 Oct 2025 15:08:24 -0400
The following commit has been merged in the master branch:
commit 863cfd184163cd1fd921c08c2f8e740adde6359a
Author: Marcio Barbosa <mbarbosa@sinenomine.net>
Date: Mon Oct 20 21:47:44 2025 +0000
tests: Run all commands through cmdwrap
Currently, the test suite relies on setting dynamic library path
environment variables (e.g., LD_LIBRARY_PATH, DYLD_LIBRARY_PATH) so that
test programs can find the just-built project libraries. This is
handled by a 'libwrap' shell script that prepends a given path to the
appropriate variable before executing a test command.
This approach fails on modern macOS systems. Due to System Integrity
Protection (SIP), the DYLD_LIBRARY_PATH variable is stripped from the
environment whenever a system-protected binary is executed. This issue
affects many of our tests, particularly those written in Perl, since SIP
prevents the system's Perl interpreter from inheriting the environment
variables set by libwrap.
To resolve this, this commit renames 'libwrap' to the more descriptive
'cmdwrap' and simplifies its invocation. The new wrapper no longer takes
the library path as a command-line argument; it is now configured at
build time. All execution points are updated to call the binary via
'cmdwrap'. Since 'cmdwrap' immediately executes our own binaries, they
are allowed to inherit the DYLD_LIBRARY_PATH variable before SIP can
interfere.
A minor behavioral change is introduced for processes started via C
'execl()' or Perl 'exec()' (tests/common/servers.c and tests/rx/perf-t).
Previously, argv[0] for these processes was set to a short name like
'vlserver'. Due to the nature of the shell 'exec' command used in
'cmdwrap', argv[0] will now be the full path to the test binary. This
is a limitation of using a portable 'sh' script, which cannot
arbitrarily set argv[0]. Rewriting cmdwrap in C could restore the
original behavior, but this simpler script is preferred for now.
Also, this change does not fix the 'make shell' target in
tests/Makefile.in on macOS. When 'make shell' executes the user's
shell (e.g., /bin/zsh), SIP will still sanitize the library path because
the shell is a system-protected binary. Developers on macOS wishing to
use 'make shell' for interactive debugging will need to set the
environment variables in question manually within the new shell.
Change-Id: Ifcff3094c1e585ada136d004f8a8a214d38f968e
Reviewed-on: https://gerrit.openafs.org/16562
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Makefile.in | 1 +
configure.ac | 4 ++-
tests/.gitignore | 1 +
tests/Makefile.in | 5 ++--
tests/auth/genkeyfiles-t | 3 +-
tests/cmdwrap.in | 50 +++++++++++++++++++++++++++++++++
tests/common/servers.c | 3 +-
tests/libwrap | 48 -------------------------------
tests/opr/softsig-t | 7 +++--
tests/ptserver/pt_util-t | 7 +++--
tests/rx/perf-t | 18 +++++++-----
tests/rx/simple-t | 7 +++--
tests/tests-lib/perl5/mancheck_utils.pm | 4 ++-
tests/volser/vos-t.c | 6 ++--
14 files changed, 91 insertions(+), 73 deletions(-)
--
OpenAFS Master Repository