diff --git a/NEWS b/NEWS index 8350e4dfa2e69..04c041e50a349 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ PHP NEWS . Using null as an array offset or when calling array_key_exists() is now deprecated. (alexandre-daubois) . Fixed bug GH-19681 (PHP_EXPAND_PATH broken with bash 5.3.0). (Remi) + . Marks the stack as non-executable on Haiku. (David Carlier) - CLI: . Fixed bug GH-19461 (Improve error message on listening error with IPv6 diff --git a/configure.ac b/configure.ac index 633244962d8d4..5059f55127b06 100644 --- a/configure.ac +++ b/configure.ac @@ -217,7 +217,12 @@ dnl supports it. This can help reduce the binary size and startup time. AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [CFLAGS="$CFLAGS -fvisibility=hidden"]) +dnl to disable executable stack on haiku due +dnl to missing elf .note.GNU-stack part case $host_alias in + *haiku*) + LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" + ;; *solaris*) CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" ;; diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 3cae726838a64..6fb75e2db1db3 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -109,7 +109,9 @@ ZEND_DECLARE_MODULE_GLOBALS(sockets) } \ } while (0) #else -#define PHP_ETH_PROTO_CHECK(protocol, family) (0) +#define PHP_ETH_PROTO_CHECK(protocol, family) \ + (void)protocol; \ + (void)family #endif static PHP_GINIT_FUNCTION(sockets); diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index d095f9ae90ec3..75dc721240e69 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -591,7 +591,7 @@ static int sapi_lsapi_activate(void) static sapi_module_struct lsapi_sapi_module = { "litespeed", - "LiteSpeed V8.2", + "LiteSpeed V8.3", php_lsapi_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index 9d8408c613395..75e014167f274 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -635,8 +635,8 @@ static inline int isPipe( int fd ) { char achPeer[128]; socklen_t len = 128; - if (( getpeername( fd, (struct sockaddr *)achPeer, &len ) != 0 )&& - ( errno == ENOTCONN )) + if ((getpeername(fd, (struct sockaddr *)achPeer, &len) != 0 ) + && (errno == ENOTCONN || errno == ENOTSOCK)) return 0; else return 1;