Detect crypt.h before permitting the helper to build.
Also, if crypt() function is missing build the helper to output BH code
with an error message instead of failing to build.
if (!nispasswd) {
/* User does not exist */
printf("ERR No such user\n");
+#if HAVE_CRYPT
} else if (strcmp(nispasswd, (char *) crypt(passwd, nispasswd)) == 0) {
/* All ok !, thanks... */
printf("OK\n");
+#else
+ } else {
+ /* Password incorrect */
+ printf("BH message=\"Missing crypto capability\"\n");
+#endif
} else {
/* Password incorrect */
printf("ERR Wrong password\n");
-AC_CHECK_HEADERS([sys/types.h rpc/rpc.h rpcsvc/yp_prot.h],[BUILD_HELPER="NIS"],,AC_INCLUDES_DEFAULT([
+AC_CHECK_HEADERS([sys/types.h rpc/rpc.h rpcsvc/yp_prot.h crypt.h],[BUILD_HELPER="NIS"],,AC_INCLUDES_DEFAULT([
#if HAVE_RPC_RPC_H
#include <rpc/rpc.h>
#endif