From d99093fb4bb5652015c06274d64083daa2439e4f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 3 Mar 2021 10:28:17 +0000 Subject: gentoo resync : 03.03.2021 --- .../files/389-ds-base-1.4.4.13-libxcrypt.patch | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 net-nds/389-ds-base/files/389-ds-base-1.4.4.13-libxcrypt.patch (limited to 'net-nds/389-ds-base/files/389-ds-base-1.4.4.13-libxcrypt.patch') diff --git a/net-nds/389-ds-base/files/389-ds-base-1.4.4.13-libxcrypt.patch b/net-nds/389-ds-base/files/389-ds-base-1.4.4.13-libxcrypt.patch new file mode 100644 index 000000000000..32f7c21a53a2 --- /dev/null +++ b/net-nds/389-ds-base/files/389-ds-base-1.4.4.13-libxcrypt.patch @@ -0,0 +1,66 @@ +From f38b124f05a169acfd55a279b9f6c178b58e73fc Mon Sep 17 00:00:00 2001 +From: Firstyear +Date: Wed, 3 Feb 2021 09:48:48 +1000 +Subject: [PATCH] Issue 4588 - BUG - unable to compile without xcrypt (#4589) + +Bug Description: If xcrypt is not available, especially on some +distros with older libraries, 389 was unable to build. + +Fix Description: Detect if we have xcrypt, and if not, add +stubs that always error instead. + +fixes: https://github.com/389ds/389-ds-base/issues/4588 + +Author: William Brown + +Review by: @progier389, @jchapma, @droideck (Thanks!) +--- + .../plugins/pwdstorage/gost_yescrypt.c | 29 +++++++++++++++++-- + 1 file changed, 26 insertions(+), 3 deletions(-) + +diff --git a/ldap/servers/plugins/pwdstorage/gost_yescrypt.c b/ldap/servers/plugins/pwdstorage/gost_yescrypt.c +index 2af1c2919..67b39395e 100644 +--- a/ldap/servers/plugins/pwdstorage/gost_yescrypt.c ++++ b/ldap/servers/plugins/pwdstorage/gost_yescrypt.c +@@ -7,11 +7,12 @@ + #include + #endif + +-#include +-#include +- + #include "pwdstorage.h" + ++#include ++ ++#ifdef XCRYPT_VERSION_STR ++#include + int + gost_yescrypt_pw_cmp(const char *userpwd, const char *dbpwd) + { +@@ -62,3 +63,25 @@ gost_yescrypt_pw_enc(const char *pwd) + + return enc; + } ++ ++#else ++ ++/* ++ * We do not have xcrypt, so always fail all checks. ++ */ ++int ++gost_yescrypt_pw_cmp(const char *userpwd __attribute__((unused)), const char *dbpwd __attribute__((unused))) ++{ ++ slapi_log_err(SLAPI_LOG_ERR, GOST_YESCRYPT_SCHEME_NAME, ++ "Unable to use gost_yescrypt_pw_cmp, xcrypt is not available.\n"); ++ return 1; ++} ++ ++char * ++gost_yescrypt_pw_enc(const char *pwd __attribute__((unused))) ++{ ++ slapi_log_err(SLAPI_LOG_ERR, GOST_YESCRYPT_SCHEME_NAME, ++ "Unable to use gost_yescrypt_pw_enc, xcrypt is not available.\n"); ++ return NULL; ++} ++#endif -- cgit v1.2.3