@@ -555,18 +555,57 @@ if test "$PHP_FPM" != "no"; then
555
555
fi
556
556
557
557
if test "$PHP_FPM_ACL" != "no" ; then
558
+ AC_MSG_CHECKING ( [ for acl user/group permissions support] )
558
559
AC_CHECK_HEADERS ( [ sys/acl.h] )
559
- dnl *BSD has acl_* built into libc.
560
- AC_CHECK_FUNC ( acl_free , [
561
- AC_DEFINE ( HAVE_FPM_ACL , 1 , [ POSIX Access Control List ] )
562
- ] ,[
563
- AC_CHECK_LIB ( acl , acl_free , [
564
- PHP_ADD_LIBRARY(acl)
565
- AC_DEFINE ( HAVE_FPM_ACL , 1 , [ POSIX Access Control List ] )
566
- ] ,[
567
- AC_MSG_ERROR ( libacl required not found )
568
- ] )
569
- ] )
560
+
561
+ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [ [ #include <sys/acl.h>
562
+ int main()
563
+ {
564
+ acl_t acl;
565
+ acl_entry_t user, group;
566
+ acl = acl_init(1);
567
+ acl_create_entry(&acl, &user);
568
+ acl_set_tag_type(user, ACL_USER);
569
+ acl_create_entry(&acl, &group);
570
+ acl_set_tag_type(user, ACL_GROUP);
571
+ acl_free(acl);
572
+ return 0;
573
+ }
574
+ ] ] ) ] , [
575
+ AC_CHECK_LIB ( acl , acl_free ,
576
+ [ PHP_ADD_LIBRARY(acl)
577
+ have_fpm_acl=yes
578
+ AC_MSG_RESULT ( [ yes] )
579
+ ] ,[
580
+ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [ #include <sys/acl.h>
581
+ int main()
582
+ {
583
+ acl_t acl;
584
+ acl_entry_t user, group;
585
+ acl = acl_init(1);
586
+ acl_create_entry(&acl, &user);
587
+ acl_set_tag_type(user, ACL_USER);
588
+ acl_create_entry(&acl, &group);
589
+ acl_set_tag_type(user, ACL_GROUP);
590
+ acl_free(acl);
591
+ return 0;
592
+ }
593
+ ] ] ) ] , [
594
+ have_fpm_acl=yes
595
+ AC_MSG_RESULT ( [ yes] )
596
+ ] , [
597
+ have_fpm_acl=no
598
+ AC_MSG_RESULT ( [ no] )
599
+ ] , [ AC_MSG_RESULT ( [ skipped] ) ] )
600
+ ] )
601
+ ] , [
602
+ have_fpm_acl=no
603
+ AC_MSG_RESULT ( [ no] )
604
+ ] , [ AC_MSG_RESULT ( [ skipped (cross-compiling)] ) ] )
605
+
606
+ if test "$have_fpm_acl" = "yes"; then
607
+ AC_DEFINE ( [ HAVE_FPM_ACL] , 1 , [ do we have acl support?] )
608
+ fi
570
609
fi
571
610
572
611
if test "x$PHP_FPM_APPARMOR" != "xno" ; then
0 commit comments