211 Commits

Author SHA1 Message Date
Alejandro Colomar
73cad5c903 configure.ac, Makefile.am: Propagate ./configure flags to 'distcheck'
'make distcheck' runs ./configure (among other things).  That command
should inherit the flags passed on the command line, as they are the
flags necessary to build in the current system.

This also allows testing different configurations in the same system.
Until now, we only tested the default automagic configuration.  With
this change, one can test the same default automagic configuration, by
not passing any flags to ./configure, or they can test more specific
configurations, by passing flags.

This allows removing the hardcoded AM_DISTCHECK_CONFIGURE_FLAGS in the
"Makefile.am".

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-12-04 20:07:22 -06:00
Alejandro Colomar
79ddd58ef6 configure.ac, lib/: Use _PATH_WTMP from <paths.h>
That's the libc macro for this file.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-15 11:47:22 +02:00
Alejandro Colomar
72a2b8a10d configure.ac, lib/, src/: Use _PATH_LASTLOG from <paths.h>
That's the libc macro for this file.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-09-15 11:47:22 +02:00
Evgeny Grin (Karlson2k)
014b6a6d89 configure.ac: cosmetics - unified check for $enable_logind value
Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
2025-08-02 12:09:13 +02:00
Evgeny Grin (Karlson2k)
324d070ff8 configure.ac: Make sure that logind is enabled if requested, make --enable-logind default
Before this commit, if configured with --enable-logind, but libsystemd
is not found, configure silently succeed, however logind is efficiently
disabled.
With this commit, the configure fails if logind is not explicitly
disabled and libsystemd is not found.
--disable-logind is mandatory if logind integration should not be used.

Automatic detection is disabled by Alejandro Colomar's request.
Extra help in the error message is added by lslebodn's request.

Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
2025-08-02 12:09:13 +02:00
Evgeny Grin (Karlson2k)
048083ab92 configure.ac: Improve formatting for libsystemd check
Improve formatting and readability of single configure check.
Also remove unneeded overquoting of "LIBSYSTEMD=-lsystemd".

Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
2025-08-02 12:09:13 +02:00
Evgeny Grin (Karlson2k)
27437f1f7a configure.ac: Add check for value given for --enable-logind
Fail with error if wrong value is provided.

Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
2025-08-02 12:09:13 +02:00
Evgeny Grin (Karlson2k)
ccc40e7d72 configure: Document --enable-logind behaviour correctly
The code does not enabled logind unconditionally by default.  Instead
configure checks for logind (libsystemd) availability and enables it
only if found.

Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
2025-08-02 12:09:13 +02:00
Evgeny Grin (Karlson2k)
2e7db49128 configure: Print configuration summary to the log (in addtion to stdout)
Signed-off-by: Ontogeny Grin (Karlson2k) <k2k@drgrin.dev>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
2025-07-19 06:42:33 +02:00
Evgeny Grin (Karlson2k)
cce24c7b65 configure: Fix outdated and non-portable 'test' syntax
Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
2025-07-19 06:42:33 +02:00
Evgeny Grin (Karlson2k)
10ca98bd11 configure: Unify checks for variable values
This is a workaround for broken shells, which incorrectly performs
'test "$var" = "value"' when variable is empty or not set.
Also this is a guard for variable values that may break "test", like
"!", "-z", "-n".

Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
2025-07-19 06:42:33 +02:00
Evgeny Grin (Karlson2k)
ced73a7779 configure: Move helper files to 'build-aux/'
Grouped autoconf settings.

Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
2025-07-19 06:42:33 +02:00
Evgeny Grin (Karlson2k)
c458839aa6 configure: Fix quoting of the "#" symbol
[[]] means "use literally, without expansion and substitution".
# symbol potentially could be interpreted as a comment.
Also fixed one check with indented " #include <security/pam_appl.h>"
which is not correct C syntax.

Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
2025-07-19 06:42:33 +02:00
Evgeny Grin (Karlson2k)
08ec7536e4 configure: Move AC_ARG_ENABLE. It cannot be conditional.
AC_ARG_ENABLE() expands to nothing where it is used, but adds arguments
parsing, help message and other related things.
It does not make any sense to put this macro into if branch.  It may
also confuse the reader.

Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
2025-07-19 06:42:33 +02:00
Evgeny Grin (Karlson2k)
630fb7ece1 configure: Unify M4 quoting
Always quoting of all arguments is recommended by autoconf manual.

The commit is checked by autoreconf -v before and after commit.
Resulting configure is identical (excluding some newlines).

Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
2025-07-19 06:42:33 +02:00
Evgeny Grin (Karlson2k)
c3878390a6 configure: Fix incorrect use of AM_CONDITIONAL
AM_CONDITIONAL() must not be used in shell's if branches.  Instead it
must be specified one time only (per conditional variable) with test
"something" as a second parameter.
See https://www.gnu.org/software/automake/manual/html_node/Usage-of-Conditionals.html#index-AM_005fCONDITIONAL-2

Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
2025-07-19 06:42:33 +02:00
Evgeny Grin (Karlson2k)
50f88ab8be configure: Remove duplicated check and unused Makefile substitution
Lines were incorrectly added by 5cd04d03f94622c12220d4a6352824af081b8531
The check is fully duplicated and does nothing except setting wrong
variable LIYESCRYPT.  Such variable was never used in the project.

Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
2025-07-19 06:42:33 +02:00
Serge Hallyn
045652a925 Release 4.18.0
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2025-06-24 15:24:05 -05:00
Serge Hallyn
8c3aa0c9af Pre-release 4.18.0-rc2
Let's do one quick prerelease before we release 4.18 tomorrow.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2025-06-23 12:16:07 -05:00
Alejandro Colomar
4773fc4167 contrib/: Burn it all
Closes: <https://github.com/shadow-maint/shadow/issues/1273>
Cc: Chris Hofstaedtler <zeha@debian.org>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-06-18 09:15:02 +02:00
Serge Hallyn
95834a1d6e Pre-release 4.18.0-rc1
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2025-06-08 20:01:59 +02:00
Samuel Thibault
ec88c2ccb8 configure: Fix typo
The test was about lastlog, not subids

Fixes: 1bdcfa8d3710 (2023-07-15; "lastlog: stop building by default")
2025-06-08 11:22:34 +02:00
Alejandro Colomar
6c62103ba6 lib/getdate.*: Reimplement in pure C
This removes all yacc(1) code from this project.  Add copyright and
license, since there remains nothing of the original code.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-06-02 09:59:51 +02:00
Alejandro Colomar
1b936816e5 configure.ac: Remove unused check for futimes(3)
Reported-by: Chris Hofstaedtler <zeha@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-05-27 09:42:39 +02:00
Alejandro Colomar
0054a72536 configure.ac, contrib/, src/: Remove dead code
Both glibc and musl provide getusershell(3).  It's an API from 4.3BSD,
according to the manual page, so let's assume it exists everywhere that
we would care, even if it's not in POSIX.

Reported-by: Chris Hofstaedtler <zeha@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-05-27 09:42:39 +02:00
Alejandro Colomar
844e03a68f lib/, configure.ac, po/: Remove dead file <lib/shadow.c>
We didn't even have prototypes for these APIs since long ago, when the
prototypes were removed, but misteriously the implementations remained.

Both glibc and musl provide getspnam(3), so this file was effectively
being ignored by the compiler.  Just remove it.

Also remove the check for getspnam, which isn't used elsewhere.

Fixes: 0ee095abd8db (2007-10-07; "[svn-upgrade] Integrating new upstream version, shadow (4.0.7)")
Closes: <https://github.com/shadow-maint/shadow/issues/1228>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-05-27 09:42:39 +02:00
Serge Hallyn
b23a5823bc release 4.17.4
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2025-03-19 14:00:22 -05:00
Chris Hofstaedtler
f9c2096c0b configure.ac: be deterministic about passwd location
Statically set PASSWD_PROGRAM depending on exec_prefix, and not by where
the passwd program was at configure time.

Depending on the specific build situation before, this may or may not
change the embedded passwd program path. Also configure.ac sets
exec_prefix=/ for prefix=/usr, so this might be a bit confusing, but
at least deterministic.

Closes: #1224
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
2025-03-02 07:59:56 +01:00
Chris Hofstaedtler
bee77ffc29 configure.ac: stop checking for utmp location
Nothing seems to use it.

Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
2025-02-25 20:01:37 +01:00
Serge Hallyn
d3fa0ba5b8 Release 4.17.3
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2025-02-24 08:12:25 -06:00
Alejandro Colomar
a8dd818ba4 configure.ac, lib/: Use __has_include(<gshadow.h>) instead of HAVE_GSHADOW_H
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-02-07 23:43:55 -06:00
Alejandro Colomar
9eea4bc9cf configure.ac: Remove unused AC_CHECK_HEADERS() checks
$ grep -rE 'HAVE_(UTMP)_H'
$ grep -rE 'HAVE_(TERMIO|SGTTY|SYS_IOCTL|PATHS)_H'
$ grep -rE 'HAVE_(LASTLOG|RPC_KEY_PROT|ACL_LIBACL)_H'
$ grep -rE 'HAVE_(ATTR_LIBATTR|ATTR_ERROR_CONTEXT)_H'
$

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-02-07 23:43:55 -06:00
Alejandro Colomar
7d992f16b4 configure.ac, lib/: Use __has_include(<sys/capability.h>) instead of HAVE_SYS_CAPABILITY_H
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-02-07 23:43:55 -06:00
Alejandro Colomar
0dcce8ea4b configure.ac, lib/: Use __has_include(<sys/random.h>) instead of HAVE_SYS_RANDOM_H
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-02-07 23:43:55 -06:00
Alejandro Colomar
87ba6c317e configure.ac, lib/: Use __has_include(<crypt.h>) instead of HAVE_CRYPT_H
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-02-07 23:43:55 -06:00
Alejandro Colomar
e083b38018 configure.ac, lib/, src/: Use gid_t instead of GETGROUPS_T
Autoconf's NEWS file says

*** AC_FUNC_GETGROUPS and AC_TYPE_GETGROUPS no longer run test programs.
  These macros were testing for OS bugs that we believe are at least
  twenty years in the past.  Most operating systems are now trusted to
  provide an accurate prototype for getgroups in unistd.h, and to
  implement it as specified in POSIX.

Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-01-24 07:58:13 -06:00
Alejandro Colomar
da6b9cff02 configure.ac, lib/gshadow.c: Presume working shadow group support in libc
This check was testing a specific bug in a prehistoric libc version.
Red Hat 3 is long dead, and it doesn't make sense to test for that
specific bug.

Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-01-24 12:10:15 +01:00
Alejandro Colomar
76727c324d configure.ac, lib/: Assume initgroups(3) exists
It's available in every system I checked: glibc,musl,{Free,Net,Open}BSD.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-01-23 19:50:01 -06:00
Alejandro Colomar
5068b2e29b configure.ac, lib/, src/: Assume setgroups(2) exists
It's available in every system I checked: glibc,musl,{Free,Net,Open}BSD.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-01-23 19:50:01 -06:00
Alejandro Colomar
6a2ab3d760 Release 4.17.2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2025-01-10 19:39:46 -06:00
Serge Hallyn
2bbe1af294 Release 4.17.1
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2024-12-31 13:23:26 -06:00
Serge Hallyn
e2512d5741 Release 4.17.0
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2024-12-25 16:32:40 -06:00
Serge Hallyn
b75ea29821 Release 4.17.0-rc1
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2024-12-05 23:52:36 -06:00
Tobias Stoeckmann
81078c57fb Fix typos
Typos in comments and configure output, i.e. no functional change.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2024-09-13 22:27:08 +02:00
Serge Hallyn
cde08e422d configure.ac: release 4.16.0
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2024-06-18 16:34:10 -05:00
Serge Hallyn
2df2c35bad release 4.16.0-rc1
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2024-06-13 21:24:10 -05:00
Serge Hallyn
9b7d786b6f configure.ac: specify tar-pax to avoid 99 char filename limit
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2024-06-13 21:24:10 -05:00
Alejandro Colomar
ca046af5d9 Remove support for rlogind in login(1), that is, remove the '-r' flag
The "quick hack" finally disappeared.  Probably nobody noticed.  ;)
(See the changes in <configure.ac> for the context of this pun.)

Probably everybody uses SSH these days for remote login.  Let's remove
this insecure method.

Closes: <https://github.com/shadow-maint/shadow/issues/992>
Reviewed-by: dkwo <nicolopiazzalunga@gmail.com>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Michael Vetter <jubalh@iodoru.org>
Cc: Sam James <sam@gentoo.org>
Cc: Benedikt Brinkmann <datacobra@thinkbot.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-06-13 19:39:26 -05:00
Iker Pedrosa
4e2453fa9f configure: move cmocka library detection
`PKG_CONFIG` variable needs to be set for `PKG_CHECK_MODULES` to
succeed, but this wasn't happening in Fedora because the first
appearance of `PKG_CHECK_MODULES` was conditionally skipped because this
distribution is compiled without `libbsd` support. Thus, moving the
cmocka library detection before libbsd fixes the problem.

Suggested-by: Lukas Slebodnik <lslebodn@fedoraproject.org>
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
2024-05-28 19:19:58 -05:00
Serge Hallyn
dc12e87fe7 configure.ac: release 4.15.1
Signed-off-by: Serge Hallyn <serge@hallyn.com>
2024-03-23 18:33:45 -05:00