diff options
author | Nikita Popov <nikic@php.net> | 2016-03-25 20:18:46 +0100 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2016-03-25 20:18:46 +0100 |
commit | 54da966883bacf28808e26eeda48fe38e21b118e (patch) | |
tree | d92eeb93c158b33f00fe8f7c5ee9c6b6f5a6f624 /ext/standard/crypt.c | |
parent | c4681ec8e10b365a83bcff34a261e7c5e62dea60 (diff) | |
download | php-git-54da966883bacf28808e26eeda48fe38e21b118e.tar.gz |
Fixed bug #67512
Diffstat (limited to 'ext/standard/crypt.c')
-rw-r--r-- | ext/standard/crypt.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index b7ac8d64bd..1b83d6e127 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -236,18 +236,23 @@ PHPAPI int php_crypt(const char *password, const int pass_len, const char *salt, # elif defined(CRYPT_R_CRYPTD) CRYPTD buffer; # else -# error Data struct used by crypt_r() is unknown. Please report. +# error Data struct used by crypt_r() is unknown. Please report. # endif crypt_res = crypt_r(password, salt, &buffer); - if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { - return FAILURE; - } else { - *result = estrdup(crypt_res); - return SUCCESS; - } } +# elif defined(HAVE_CRYPT) + crypt_res = crypt(password, salt); +# else +# error No crypt() implementation # endif #endif + + if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { + return FAILURE; + } else { + *result = estrdup(crypt_res); + return SUCCESS; + } } /* }}} */ |