Skip to content

Commit

Permalink
Fix crypt_r detection under BSD system
Browse files Browse the repository at this point in the history
For BSD systems, crypt.h does not exist, instead we need to
include unistd.h.

Closes GH-5971.
  • Loading branch information
devnexen authored and nikic committed Aug 12, 2020
1 parent 3485ec4 commit 6ca6e9f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2217,6 +2217,17 @@ crypt_r("passwd", "hash", &buffer);
fi
])
if test "$php_cv_crypt_r_style" = "none"; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdlib.h>
#include <unistd.h>
]],[[
struct crypt_data buffer;
crypt_r("passwd", "hash", &buffer);
]])],[php_cv_crypt_r_style=struct_crypt_data],[])
fi
])

if test "$php_cv_crypt_r_style" = "cryptd"; then
AC_DEFINE(CRYPT_R_CRYPTD, 1, [Define if crypt_r has uses CRYPTD])
fi
Expand Down

0 comments on commit 6ca6e9f

Please sign in to comment.