Require libxcrypt-4.4.0 or newer and drop support of libcrypt

libcrypt was no longer built by default since glibc-2.38, and it has been
completely removed since glibc-2.39.

Let's always use libxcrypt, unless when building with musl. As already
major distribution already have libxcrypt-4.4.x, hence let's also bump
the required minimum version to 4.4.0.

libxcrypt cannot be built with musl, hence the previous fallback logic
in libcrypt-util.c are moved to musl/crypt.c.

Note, libxcrypt-4.4.0 was released on 2018-11-20.
See also #38608.
This commit is contained in:
Yu Watanabe
2026-01-02 12:55:53 +09:00
parent 8608d2e910
commit 5863641bb7
7 changed files with 135 additions and 126 deletions
+13
View File
@@ -0,0 +1,13 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include_next <crypt.h>
const char* missing_crypt_preferred_method(void);
#define crypt_preferred_method missing_crypt_preferred_method
char* missing_crypt_gensalt_ra(const char *prefix, unsigned long count, const char *rbytes, int nrbytes);
#define crypt_gensalt_ra missing_crypt_gensalt_ra
char* missing_crypt_ra(const char *phrase, const char *setting, void **data, int *size);
#define crypt_ra missing_crypt_ra