@@ -600,18 +600,57 @@ if test "$PHP_FPM" != "no"; then
600
600
fi
601
601
602
602
if test "$PHP_FPM_ACL" != "no" ; then
603
+ AC_MSG_CHECKING ( [ for acl user/group permissions support] )
603
604
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
615
654
fi
616
655
617
656
if test "x$PHP_FPM_APPARMOR" != "xno" ; then
0 commit comments