Replace the session-keyring option with a configure option

Join the new session keyring when the server starts rather than once the
configuration file has been loaded, and control it at build time with
--enable-keyring, on by default if linux/keyctl.h is found.

Rename keyring_join and keyring_revoke to new_session_keyring and
revoke_session_keyring.
This commit is contained in:
Ilya Priven
2026-10-12 11:26:28 +00:00
parent 3d0839b7a3
commit 90cc41de32
8 changed files with 34 additions and 60 deletions

View File

@@ -795,10 +795,18 @@ else
AC_LIBOBJ(daemon)
fi
# Look for linux/keyctl.h, compat/keyring-linux.c used if found.
AC_CHECK_HEADER(linux/keyctl.h, found_keyctl=yes, found_keyctl=no)
if test "x$found_keyctl" = xyes; then
AC_DEFINE(HAVE_KEYCTL)
# Look for linux/keyctl.h, compat/keyring-linux.c used if found and enabled.
AC_ARG_ENABLE(
keyring,
AS_HELP_STRING(--disable-keyring, disable giving the server its own Linux session keyring)
)
if test "x$enable_keyring" != xno; then
AC_CHECK_HEADER(linux/keyctl.h, found_keyctl=yes, found_keyctl=no)
if test "x$found_keyctl" = xyes; then
AC_DEFINE(HAVE_KEYCTL)
elif test "x$enable_keyring" = xyes; then
AC_MSG_ERROR("linux/keyctl.h not found")
fi
fi
AM_CONDITIONAL(HAVE_KEYCTL, [test "x$found_keyctl" = xyes])