You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2014/08/19 13:32:37 UTC
svn commit: r1618843 - /apr/apr/trunk/crypto/apr_passwd.c
Author: trawick
Date: Tue Aug 19 11:32:37 2014
New Revision: 1618843
URL: http://svn.apache.org/r1618843
Log:
Fix Android compile error caused by assumption that crypt is available.
PR: 56627
Submitted by: Fredrik Fornwall <fredrik fornwall.net>, trawick
Modified:
apr/apr/trunk/crypto/apr_passwd.c
Modified: apr/apr/trunk/crypto/apr_passwd.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/crypto/apr_passwd.c?rev=1618843&r1=1618842&r2=1618843&view=diff
==============================================================================
--- apr/apr/trunk/crypto/apr_passwd.c (original)
+++ apr/apr/trunk/crypto/apr_passwd.c Tue Aug 19 11:32:37 2014
@@ -92,6 +92,12 @@ static void crypt_mutex_unlock()
#endif
#endif
+#if defined(WIN32) || defined(BEOS) || defined(NETWARE) || defined(__ANDROID__)
+#define CRYPT_MISSING 1
+#else
+#define CRYPT_MISSING 0
+#endif
+
/*
* Validate a plaintext password against a smashed one. Uses either
* crypt() (if available) or apr_md5_encode() or apr_sha1_base64(), depending
@@ -103,7 +109,7 @@ APR_DECLARE(apr_status_t) apr_password_v
const char *hash)
{
char sample[200];
-#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE)
+#if !CRYPT_MISSING
char *crypt_pw;
#endif
if (hash[0] == '$'
@@ -126,7 +132,7 @@ APR_DECLARE(apr_status_t) apr_password_v
/*
* It's not our algorithm, so feed it to crypt() if possible.
*/
-#if defined(WIN32) || defined(BEOS) || defined(NETWARE)
+#if CRYPT_MISSING
return (strcmp(passwd, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH;
#elif defined(CRYPT_R_CRYPTD)
apr_status_t rv;