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:45:07 UTC
svn commit: r1618845 - in /apr/apr-util/branches/1.5.x: ./ CHANGES
crypto/apr_passwd.c
Author: trawick
Date: Tue Aug 19 11:45:07 2014
New Revision: 1618845
URL: http://svn.apache.org/r1618845
Log:
Merge r1618843 from apr trunk:
Fix Android compile error caused by assumption that crypt is available.
PR: 56627
Submitted by: Fredrik Fornwall <fredrik fornwall.net>, trawick
Modified:
apr/apr-util/branches/1.5.x/ (props changed)
apr/apr-util/branches/1.5.x/CHANGES
apr/apr-util/branches/1.5.x/crypto/apr_passwd.c
Propchange: apr/apr-util/branches/1.5.x/
------------------------------------------------------------------------------
Merged /apr/apr/trunk:r1618843
Modified: apr/apr-util/branches/1.5.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/CHANGES?rev=1618845&r1=1618844&r2=1618845&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/CHANGES [utf-8] (original)
+++ apr/apr-util/branches/1.5.x/CHANGES [utf-8] Tue Aug 19 11:45:07 2014
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes with APR-util 1.5.4
+ *) Fix compile failure for Android. PR 56627. [Fredrik Fornwall
+ <fredrik fornwall.net>, Jeff Trawick]
+
*) Fix to let ODBC driver build with MSVC6, which does not have intptr_t
[Tom Donovan]
Modified: apr/apr-util/branches/1.5.x/crypto/apr_passwd.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/crypto/apr_passwd.c?rev=1618845&r1=1618844&r2=1618845&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/crypto/apr_passwd.c (original)
+++ apr/apr-util/branches/1.5.x/crypto/apr_passwd.c Tue Aug 19 11:45:07 2014
@@ -66,6 +66,12 @@ static void crypt_mutex_unlock(void)
#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
@@ -77,7 +83,7 @@ APU_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] == '$'
@@ -100,7 +106,7 @@ APU_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;