Skip to content

Commit 2acc386

Browse files
committed
Fixed bug #65226 chroot() does not get enabled
1 parent 96f77f8 commit 2acc386

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ PHP NEWS
1313
. Fixed bug #62475 (variant_* functions causes crash when null given as an
1414
argument). (Felipe)
1515
. Fixed bug #60732 (php_error_docref links to invalid pages). (Jakub Vrana)
16+
. Fixed bug #65226 (chroot() does not get enabled). (Anatol)
1617

1718
- CGI:
1819
. Fixed Bug #65143 (Missing php-cgi man page). (Remi)

ext/standard/config.m4

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,29 @@ else
358358
AC_MSG_RESULT(no)
359359
fi
360360

361-
if test "$PHP_SAPI" = "cgi" || test "$PHP_SAPI" = "cli" || test "$PHP_SAPI" = "embed"; then
361+
PHP_ENABLE_CHROOT_FUNC=no
362+
case "$PHP_SAPI" in
363+
embed)
364+
PHP_ENABLE_CHROOT_FUNC=yes
365+
;;
366+
367+
none)
368+
for PROG in $PHP_BINARIES; do
369+
case "$PROG" in
370+
cgi|cli)
371+
PHP_ENABLE_CHROOT_FUNC=yes
372+
;;
373+
374+
*)
375+
PHP_ENABLE_CHROOT_FUNC=no
376+
break
377+
;;
378+
esac
379+
done
380+
;;
381+
esac
382+
383+
if test "$PHP_ENABLE_CHROOT_FUNC" = "yes"; then
362384
AC_DEFINE(ENABLE_CHROOT_FUNC, 1, [Whether to enable chroot() function])
363385
fi
364386

0 commit comments

Comments
 (0)