crypt_header = conf.get('HAVE_CRYPT_H') == 1 ? '''#include <crypt.h>''' : '''#include <unistd.h>'''
foreach ident : [
- ['crypt_ra', crypt_header],
- ['crypt_gensalt_ra', crypt_header]]
+ ['crypt_ra', crypt_header],
+ ['crypt_preferred_method', crypt_header],
+ ['crypt_gensalt_ra', crypt_header]]
have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE',
dependencies : libcrypt)
e = secure_getenv("SYSTEMD_CRYPT_PREFIX");
if (!e)
+#if HAVE_CRYPT_PREFERRED_METHOD
e = crypt_preferred_method();
+#else
+ e = "$6$";
+#endif
log_debug("Generating salt for hash prefix: %s", e);