From: Amos Jeffries Date: Sat, 22 Mar 2014 12:03:18 +0000 (-0600) Subject: Portability: Basic auth NIS helper depends on crypt() X-Git-Tag: SQUID_3_5_0_1~326 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11978f8425d2316cb681daae48d530d6fcf6439e;p=thirdparty%2Fsquid.git Portability: Basic auth NIS helper depends on crypt() 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. --- diff --git a/helpers/basic_auth/NIS/basic_nis_auth.cc b/helpers/basic_auth/NIS/basic_nis_auth.cc index 3ba4b19585..b2f9a8bee3 100644 --- a/helpers/basic_auth/NIS/basic_nis_auth.cc +++ b/helpers/basic_auth/NIS/basic_nis_auth.cc @@ -65,9 +65,15 @@ main(int argc, char **argv) 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"); diff --git a/helpers/basic_auth/NIS/required.m4 b/helpers/basic_auth/NIS/required.m4 index 9d046673e6..64d3429af6 100755 --- a/helpers/basic_auth/NIS/required.m4 +++ b/helpers/basic_auth/NIS/required.m4 @@ -1,4 +1,4 @@ -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 #endif