Description: Fix issues with UI_UTIL_read_pw_string on GNU/Hurd
The symbol hc_UTIL_read_pw_string is defined in hcrypto but yafc is not linked
with -lhcrypto. For some reason this works on !hurd-i386 but fails on
hurd-i386.
Origin: upstream, https://github.com/sebastinas/yafc/commit/a507003a
Last-Update: 2012-05-06
--- a/configure.ac
+++ b/configure.ac
@@ -190,11 +190,19 @@
#include <openssl/ui_compat.h>
#endif
])
-AC_CHECK_DECLS(UI_UTIL_read_pw_string, [yafc_have_read_pw_string="yes"],,
+AC_CHECK_DECLS(hc_UI_UTIL_read_pw_string,
+ [
+ AC_SEARCH_LIBS(hc_UI_UTIL_read_pw_string, hcrypto,
+ [yafc_have_read_pw_string="yes"])
+ ],,
[
#ifdef HAVE_HCRYPTO_UI_H
#include <hcrypto/ui.h>
- #elif defined(HAVE_OPENSSL_UI_H)
+ #endif
+ ])
+AC_CHECK_DECLS(UI_UTIL_read_pw_string, [yafc_have_read_pw_string="yes"],,
+ [
+ #if defined(HAVE_OPENSSL_UI_H)
#include <openssl/ui.h>
#endif
])
--- a/src/input.c
+++ b/src/input.c
@@ -82,9 +82,11 @@ char *input_read_string(const char *prompt)
char *getpass_hook(const char *prompt)
{
-#if HAVE_DECL_UI_UTIL_READ_PW_STRING || HAVE_DECLDES_READ_PW_STRING
+#if HAVE_DECL_HC_UI_UTIL_READ_PW_STRING || HAVE_DECL_UI_UTIL_READ_PW_STRING || HAVE_DECL_DES_READ_PW_STRING
char tmp[80];
-#if HAVE_DECL_UI_UTIL_READ_PW_STRING
+#if HAVE_DECL_HC_UI_UTIL_READ_PW_STRING
+ hc_UI_UTIL_read_pw_string(tmp, sizeof(tmp), (char*)prompt, 0);
+#elif HAVE_DECL_UI_UTIL_READ_PW_STRING
UI_UTIL_read_pw_string(tmp, sizeof(tmp), (char*)prompt, 0);
#else
des_read_pw_string(tmp, sizeof(tmp), (char *)prompt, 0);