Commit Graph

8 Commits

Author SHA1 Message Date
Dmitry V. Levin
613e59dca7 build: drop autotools support
There is no point in supporting two different build systems.
2024-10-23 08:00:00 +00:00
Dmitry V. Levin
7fb6beed01 meson: build Linux-PAM using meson
On my non-representative hardware, the full build using autotools
(./autogen.sh && CFLAGS=-O2 ./configure && make -j`nproc` && make -j`nproc` install)
takes about 45 seconds.

On the same hardware, the full build using meson
(meson setup -Doptimization=2 dir && meson compile -C dir && meson install -C dir)
takes just about 7.5 seconds.
2024-09-10 08:00:00 +00:00
Dmitry V. Levin
bbc52034e4 build: parametrize libtool subdirectory
Unhardcode ".libs" subdirectory where libtool stores shared objects,
as other build systems doesn't necessarily use it.

* configure.ac (AC_DEFINE_UNQUOTED): Add LTDIR.
* modules/pam_canonicalize_user/tst-pam_canonicalize_user-retval.c:
Replace ".libs/" with LTDIR.
* modules/pam_debug/tst-pam_debug-retval.c: Likewise.
* modules/pam_deny/tst-pam_deny-retval.c: Likewise.
* modules/pam_echo/tst-pam_echo-retval.c: Likewise.
* modules/pam_env/tst-pam_env-retval.c: Likewise.
* modules/pam_faildelay/tst-pam_faildelay-retval.c: Likewise.
* modules/pam_faillock/tst-pam_faillock-retval.c: Likewise.
* modules/pam_listfile/tst-pam_listfile-retval.c: Likewise.
* modules/pam_localuser/tst-pam_localuser-retval.c: Likewise.
* modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c: Likewise.
* modules/pam_nologin/tst-pam_nologin-retval.c: Likewise.
* modules/pam_permit/tst-pam_permit-retval.c: Likewise.
* modules/pam_pwhistory/tst-pam_pwhistory-retval.c: Likewise.
* modules/pam_rootok/tst-pam_rootok-retval.c: Likewise.
* modules/pam_sepermit/tst-pam_sepermit-retval.c: Likewise.
* modules/pam_succeed_if/tst-pam_succeed_if-retval.c: Likewise.
* modules/pam_time/tst-pam_time-retval.c: Likewise.
* modules/pam_warn/tst-pam_warn-retval.c: Likewise.
2024-08-22 08:00:00 +00:00
Tobias Stoeckmann
70773c1a25 modules: add pamc headers to the search path only when needed
The pam client library libpamc is only needed if libpam_misc is in use.
But libpam_misc is only used by an SELinux helper binary.

Remove the libpamc includes from the search path in all other cases.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2024-01-21 22:36:10 +00:00
Tobias Stoeckmann
2b8895da5e treewide: strictly separate builddir and srcdir
Building outside of source directory fails if --disable-doc is not
explicitly chosen.

This happens because generated files are sometimes expected in the
source directory, where they won't exist.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2024-01-12 18:01:01 +01:00
Dmitry V. Levin
6a7f41906d pam_canonicalize_user: fix the test for return values
* modules/pam_canonicalize_user/tst-pam_canonicalize_user-retval.c: Fix.
* modules/pam_canonicalize_user/Makefile.am (TESTS): Add $(check_PROGRAMS).
(AM_LDFLAGS): Rename to pam_canonicalize_user_la_LDFLAGS.
(tst_pam_canonicalize_user_retval_LDFLAGS): New variable.

Fixes: 980ddf7067 ("pam_canonicalize_user: add a test for return values")
2023-12-30 08:00:00 +00:00
Dmitry V. Levin
980ddf7067 pam_canonicalize_user: add a test for return values
* modules/pam_canonicalize_user/tst-pam_canonicalize_user-retval.c: New
file.
* modules/pam_canonicalize_user/Makefile.am (TESTS): Add
$(check_PROGRAMS).
(check_PROGRAMS, tst_pam_canonicalize_user_retval_LDADD): New variables.
2023-11-14 23:25:00 +00:00
Dmitry V. Levin
2cae0f5c67 pam_canonicalize_user: new module to canonicalize user name
This module uses the name of the user obtained via pam_get_user(3)
as a key to query the password database, and replaces PAM_USER
with the pw_name value that has been returned.

The main usage scenario is systems where a user name is used in several
distinct authentication systems, some of them being case sensitive while
others are not.

* configure.ac (AC_CONFIG_FILES): Add
modules/pam_canonicalize_user/Makefile.
* doc/sag/pam_canonicalize_user.xml: New file.
* doc/sag/Linux-PAM_SAG.xml: Add a reference to
pam_canonicalize_user.xml.
* modules/Makefile.am (SUBDIRS): Add pam_canonicalize_user.
* modules/pam_canonicalize_user/Makefile.am: New file.
* modules/pam_canonicalize_user/README.xml: New file.
* modules/pam_canonicalize_user/pam_canonicalize_user.8.xml: New file.
* modules/pam_canonicalize_user/pam_canonicalize_user.c: New file.
* modules/pam_canonicalize_user/tst-pam_canonicalize_user: New file.
2023-11-14 23:25:00 +00:00