From 670a1ff8f97962efd6b27436b50fc51b62683c25 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 1 Sep 2019 17:25:49 +0200 Subject: Fix password checking with as-needed linking Newer gcc toolchains tend to enable as-needed by default, so runtime detection of libcrypt will fail. We can just explicitly link against libcrypt anyway. * configure.ac: Check for `crypt()' in libcrypt. * config.make.in: Substitute HAVE_LIBCRYPT. * libshouldbeinlibc/idvec-verify.c: Include only when libcrypt is available. Replace weak reference with explicit call and fallback macro. * utils/x.c: Likewise. * libshouldbeinlibc/Makefile (LDLIBS): Add -lcrypt when libcrypt is available. --- config.make.in | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config.make.in') diff --git a/config.make.in b/config.make.in index 7b62e851..28d4501e 100644 --- a/config.make.in +++ b/config.make.in @@ -96,6 +96,9 @@ libblkid_LIBS = @libblkid_LIBS@ # Whether Sun RPC support is available. HAVE_SUN_RPC = @HAVE_SUN_RPC@ +# Whether we found libcrypt. +HAVE_LIBCRYPT = @HAVE_LIBCRYPT@ + # Whether we found libgcrypt. HAVE_LIBGCRYPT = @HAVE_LIBGCRYPT@ -- cgit v1.2.3