Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 50 additions & 11 deletions sapi/fpm/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -600,18 +600,57 @@ if test "$PHP_FPM" != "no"; then
fi

if test "$PHP_FPM_ACL" != "no" ; then
AC_MSG_CHECKING([for acl user/group permissions support])
AC_CHECK_HEADERS([sys/acl.h])
dnl *BSD has acl_* built into libc.
AC_CHECK_FUNC(acl_free, [
AC_DEFINE(HAVE_FPM_ACL, 1, [ POSIX Access Control List ])
],[
AC_CHECK_LIB(acl, acl_free, [
PHP_ADD_LIBRARY(acl)
AC_DEFINE(HAVE_FPM_ACL, 1, [ POSIX Access Control List ])
],[
AC_MSG_ERROR(libacl required not found)
])
])

AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/acl.h>
int main()
{
acl_t acl;
acl_entry_t user, group;
acl = acl_init(1);
acl_create_entry(&acl, &user);
acl_set_tag_type(user, ACL_USER);
acl_create_entry(&acl, &group);
acl_set_tag_type(user, ACL_GROUP);
acl_free(acl);
return 0;
}
]])], [
AC_CHECK_LIB(acl, acl_free,
[PHP_ADD_LIBRARY(acl)
have_fpm_acl=yes
AC_MSG_RESULT([yes])
],[
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/acl.h>
int main()
{
acl_t acl;
acl_entry_t user, group;
acl = acl_init(1);
acl_create_entry(&acl, &user);
acl_set_tag_type(user, ACL_USER);
acl_create_entry(&acl, &group);
acl_set_tag_type(user, ACL_GROUP);
acl_free(acl);
return 0;
}
]])], [
have_fpm_acl=yes
AC_MSG_RESULT([yes])
], [
have_fpm_acl=no
AC_MSG_RESULT([no])
], [AC_MSG_RESULT([skipped])])
])
], [
have_fpm_acl=no
AC_MSG_RESULT([no])
], [AC_MSG_RESULT([skipped (cross-compiling)])])

if test "$have_fpm_acl" = "yes"; then
AC_DEFINE([HAVE_FPM_ACL], 1, [do we have acl support?])
fi
fi

if test "x$PHP_FPM_APPARMOR" != "xno" ; then
Expand Down