diff -urN hylafax-5.5.6.orig/hfaxd/Login.c++ hylafax-5.5.6/hfaxd/Login.c++ --- hylafax-5.5.6.orig/hfaxd/Login.c++ 2015-04-22 22:04:44.000000000 +0200 +++ hylafax-5.5.6/hfaxd/Login.c++ 2015-04-28 09:40:55.557593865 +0200 @@ -30,9 +30,6 @@ #include #include #include -#if HAS_CRYPT_H -#include -#endif void HylaFAXServer::loginRefused(const char* why) @@ -443,7 +440,7 @@ * Check hosts.hfaxd first, then PAM, and last, LDAP */ if (pass[0] != '\0') { - char* ep = crypt(pass, passWd); + const char* ep = Sys::crypt(pass, passWd); if ((ep && strcmp(ep, passWd) == 0) || pamCheck(the_user, pass) || ldapCheck(the_user, pass)) { @@ -526,7 +523,7 @@ { fxAssert(IS(LOGGEDIN), "ADMIN command permitted when not logged in"); // NB: null adminWd is permitted - char* ep = crypt(pass, adminWd); + const char* ep = Sys::crypt(pass, adminWd); if ((!ep || strcmp(ep, adminWd) != 0) && !pamIsAdmin()) { if (++adminAttempts >= maxAdminAttempts) { reply(530, "Password incorrect (closing connection)."); diff -urN hylafax-5.5.6.orig/hfaxd/SNPPServer.c++ hylafax-5.5.6/hfaxd/SNPPServer.c++ --- hylafax-5.5.6.orig/hfaxd/SNPPServer.c++.org 2015-04-22 22:04:44.000000000 +0200 +++ hylafax-5.5.6/hfaxd/SNPPServer.c++ 2015-04-28 09:43:39.941592019 +0200 @@ -36,9 +36,6 @@ #include "RE.h" #include -#if HAS_CRYPT_H -#include -#endif extern "C" { #include @@ -1004,7 +1001,7 @@ if (checkUser(loginID)) { if (passWd != "") { if (pass[0] != '\0') { - char* ep = crypt(pass, passWd); + const char* ep = Sys::crypt(pass, passWd); if ((ep && streq(ep, passWd)) || pamCheck(the_user, pass)) { // log-in successful diff -urN hylafax-5.5.6.orig/hfaxd/User.c++ hylafax-5.5.6/hfaxd/User.c++ --- hylafax-5.5.6.orig/hfaxd/User.c++ 2015-04-28 09:44:37.676131453 +0200 +++ hylafax-5.5.6/hfaxd/User.c++ 2015-04-28 09:45:05.005966447 +0200 @@ -30,9 +30,6 @@ #include #include -#if HAS_CRYPT_H -#include -#endif #include #ifndef CHAR_BIT @@ -374,7 +371,7 @@ #else to64(&salt[0], random(), 2); #endif - result = crypt(pass, salt); + result = Sys::crypt(pass, salt); return (true); } diff -urN hylafax-5.5.6.orig/util/Sys.h hylafax-5.5.6/util/Sys.h --- hylafax-5.5.6.orig/util/Sys.h 2015-04-28 09:46:37.843007850 +0200 +++ hylafax-5.5.6/util/Sys.h 2015-04-28 09:48:31.614154196 +0200 @@ -44,6 +44,10 @@ #include #endif +#if HAS_CRYPT_H +#include +#endif + /* * Wrapper functions for C library calls. * @@ -140,5 +144,8 @@ { return ::fopen(filename, mode); } static int getOpenMax(); + + static const char* crypt(const char* key, const char* salt) + { const char* enc = ::crypt(key, salt); return enc ? enc : ""; } }; #endif /* _Sys_ */