Skip to content

Commit 6e0a378

Browse files
committed
Merge branch 'PHP-8.1'
2 parents 0bcffa6 + e28e0ad commit 6e0a378

File tree

1 file changed

+50
-11
lines changed

1 file changed

+50
-11
lines changed

sapi/fpm/config.m4

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -600,18 +600,57 @@ if test "$PHP_FPM" != "no"; then
600600
fi
601601

602602
if test "$PHP_FPM_ACL" != "no" ; then
603+
AC_MSG_CHECKING([for acl user/group permissions support])
603604
AC_CHECK_HEADERS([sys/acl.h])
604-
dnl *BSD has acl_* built into libc.
605-
AC_CHECK_FUNC(acl_free, [
606-
AC_DEFINE(HAVE_FPM_ACL, 1, [ POSIX Access Control List ])
607-
],[
608-
AC_CHECK_LIB(acl, acl_free, [
609-
PHP_ADD_LIBRARY(acl)
610-
AC_DEFINE(HAVE_FPM_ACL, 1, [ POSIX Access Control List ])
611-
],[
612-
AC_MSG_ERROR(libacl required not found)
613-
])
614-
])
605+
606+
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <sys/acl.h>
607+
int main()
608+
{
609+
acl_t acl;
610+
acl_entry_t user, group;
611+
acl = acl_init(1);
612+
acl_create_entry(&acl, &user);
613+
acl_set_tag_type(user, ACL_USER);
614+
acl_create_entry(&acl, &group);
615+
acl_set_tag_type(user, ACL_GROUP);
616+
acl_free(acl);
617+
return 0;
618+
}
619+
]])], [
620+
AC_CHECK_LIB(acl, acl_free,
621+
[PHP_ADD_LIBRARY(acl)
622+
have_fpm_acl=yes
623+
AC_MSG_RESULT([yes])
624+
],[
625+
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/acl.h>
626+
int main()
627+
{
628+
acl_t acl;
629+
acl_entry_t user, group;
630+
acl = acl_init(1);
631+
acl_create_entry(&acl, &user);
632+
acl_set_tag_type(user, ACL_USER);
633+
acl_create_entry(&acl, &group);
634+
acl_set_tag_type(user, ACL_GROUP);
635+
acl_free(acl);
636+
return 0;
637+
}
638+
]])], [
639+
have_fpm_acl=yes
640+
AC_MSG_RESULT([yes])
641+
], [
642+
have_fpm_acl=no
643+
AC_MSG_RESULT([no])
644+
], [AC_MSG_RESULT([skipped])])
645+
])
646+
], [
647+
have_fpm_acl=no
648+
AC_MSG_RESULT([no])
649+
], [AC_MSG_RESULT([skipped (cross-compiling)])])
650+
651+
if test "$have_fpm_acl" = "yes"; then
652+
AC_DEFINE([HAVE_FPM_ACL], 1, [do we have acl support?])
653+
fi
615654
fi
616655

617656
if test "x$PHP_FPM_APPARMOR" != "xno" ; then

0 commit comments

Comments
 (0)