summaryrefslogtreecommitdiff
path: root/sapi
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2019-10-213-4/+72
|\ | | | | | | | | | | | | * PHP-7.3: Fix bug #78599 (env_path_info underflow can lead to RCE) (CVE-2019-11043) bump versions after release set versions for release
| * Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2019-10-213-4/+72
| |\ | | | | | | | | | | | | | | | | | | * PHP-7.2: Fix bug #78599 (env_path_info underflow can lead to RCE) (CVE-2019-11043) bump versions after release set versions for release
| | * Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2019-10-213-4/+72
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.1: Fix bug #78599 (env_path_info underflow can lead to RCE) (CVE-2019-11043) bump versions after release set versions for release
| | | * Fix bug #78599 (env_path_info underflow can lead to RCE) (CVE-2019-11043)Jakub Zelenka2019-10-203-4/+72
| | | |
| | | * Sync leading and final newlines in *.phpt sectionsPeter Kokot2018-10-1526-27/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines in all *.phpt sections. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| | | * Trim trailing whitespace in *.phptPeter Kokot2018-10-1463-122/+122
| | | |
| | | * Sync leading and final newlines in source code filesPeter Kokot2018-10-1479-121/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
| | | * Trim trailing whitespace in source code filesPeter Kokot2018-10-1333-330/+330
| | | |
* | | | Skip fpm bug #74083 test on WindowsMaksim Nikulin2019-10-201-0/+1
| | | | | | | | | | | | | | | | Have not expected side effects of `include`.
* | | | Add (slow) test for fpm concurrent reloads #74083Maksim Nikulin2019-10-201-0/+76
| | | |
* | | | Block signals during fpm master initializationMaksim Nikulin2019-10-204-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix PHP-FPM failure in the case of concurrent reload attempts. Postpone signal delivery to the fpm master process till proper signal handlers are set. Prevent the following case: - Running master process receives `SIGUSR2` and performs `execvp()`. - Another `SIGUSR2` is arrived before signal handlers are set. - Master process dies. - Requests to the HTTP server handled by PHP-fpm can not be served any more. Block some signals using `sigprocmask()` before `execvp()` and early in the `main()` function. Unblock signals as soon as proper handlers are set. Fixes bug #74083
* | | | Fix miscellaneous typos in docsTyson Andre2019-10-191-1/+1
| | | |
* | | | Revert "Link executable files using non PIC object files. This reduces PIC ↵Dmitry Stogov2019-10-105-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | overhead and improves performance." This reverts commit eef85229d0fe9f69d325aa0231e592f35c468afb.
* | | | Fix borked SKIPIFsFabien Villepinte2019-09-302-4/+10
| | | |
* | | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-09-306-4/+16
|\ \ \ \ | |/ / /
| * | | Fix #78413: php-fpm request_terminate_timeout does not take effect after ↵Sergei Turchanov2019-09-306-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fastcgi_finish_request To retain legacy behavior I decided to add an option to control request termination logic. If request_terminate_timeout_track_finished is set, then request will be tracked for time limits even after fastcgi_finish_request was called. This patch depends on the fix provided in BUG 78469 (otherwise php-fpm workers listening on named pipes on Windows will be erroneously terminated) (PR #4636)
* | | | XFAIL sapi/fpm/tests/log-bwd-multiple-msgs-stdout-stderr.phptNikita Popov2019-09-271-0/+2
| | | | | | | | | | | | | | | | | | | | This is supposed to be addressed by GH-4007, but that seems stalled for now.
* | | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-09-171-4/+4
|\ \ \ \ | |/ / /
| * | | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-09-171-4/+4
| |\ \ \ | | |/ /
| | * | Add tilde to allowed status/ping pathDrakano2019-09-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Because of user specific webdirs it should be possible to set a status/ping path like "/~username/status". Closes GH-4698.
* | | | Fix symtable_cache_limit assignment in phpdbgNikita Popov2019-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | The meaning of the limit changed in 7.4, it now points one past the end. Adjust code accordingly.
* | | | Link executable files using non PIC object files. This reduces PIC overhead ↵Dmitry Stogov2019-09-075-7/+7
| | | | | | | | | | | | | | | | and improves performance.
* | | | Fix pipe detection and stream position handlingNikita Popov2019-09-051-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two related changes here: 1. Also check for S_ISCHR/FILE_TYPE_CHAR when checking for pipes, so that we detect ttys as well, which are also not seekable. 2. Always set position=-1 (i.e. ftell will return false) when a pipe is detected. Previously position=0 was sometimes used, depending on whether we're on Windows/Linux and whether the FD or FILE codepath was used.
* | | | Avoid accessing undefined index in CLI server testNikita Popov2019-08-301-3/+3
| | | |
* | | | Don't call Reflection::export() in --rf etc implementationNikita Popov2019-08-301-1/+2
| | | | | | | | | | | | | | | | | | | | This method is deprecated ... instead simply directly print the object.
* | | | Merge branch 'PHP-7.3' into PHP-7.4Jakub Zelenka2019-08-267-9/+91
|\ \ \ \ | |/ / /
| * | | Fix bug #78334 (fpm log prefix message includes wrong stdout/stderr notation)Tsuyoshi Sadakata2019-08-267-9/+91
| | | |
* | | | Fix noalias violation in select callNikita Popov2019-08-231-3/+2
| | | |
* | | | Fix FPM timer event re-registrationNikita Popov2019-07-303-12/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that fpm_event_add calls inside a timer callback work by unregistering the event from the queue before invoking its callback. The read timeout in tester.inc is increased because the added test needs two seconds (one for SIGTERM, one for SIGKILL) until the reload succeeds, so we should wait longer than that for a response.
* | | | Remove AC_FPM_POLLPeter Kokot2019-07-241-25/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | AC_FPM_POLL defines HAVE_POLL symbol which is already checked by configure.ac and function poll in AC_CHECK_FUNCTIONS. Closes GH-4449
* | | | Fix bindpath mem leak in cgiDavid Carlier2019-07-241-0/+1
| | | | | | | | | | | | | | | | Closes GH-4451.
* | | | Revert "Drop free_filename field from zend_file_handle"Nikita Popov2019-07-242-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e0eca262852dba1a78afcde64a49126c81fead1a. free_filename is used by the wincache extension, restore this field for PHP 7.4.
* | | | Report errors from stream read and write operationsNikita Popov2019-07-222-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The php_stream_read() and php_stream_write() functions now return an ssize_t value, with negative results indicating failure. Functions like fread() and fwrite() will return false in that case. As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams should not be regarded as error conditions, and be reported as successful zero-length reads/writes instead. The handling of EINTR remains unclear and is internally inconsistent (e.g. some code-paths will automatically retry on EINTR, while some won't). I'm landing this now to make sure the stream wrapper ops API changes make it into 7.4 -- however, if the user-facing changes turn out to be problematic we have the option of clamping negative returns to zero in php_stream_read() and php_stream_write() to restore the old behavior in a relatively non-intrusive manner.
* | | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-07-221-46/+0
|\ \ \ \ | |/ / /
| * | | Remove test for bug #77185Nikita Popov2019-07-221-46/+0
| | | | | | | | | | | | | | | | Seems to be very unreliable in CI.
* | | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-07-221-1/+1
|\ \ \ \ | |/ / /
| * | | Reduce number of workers in testNikita Popov2019-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | 4 seems to be enough to reliably reproduce the issue. Let's see if this works better in CI.
* | | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-07-222-1/+60
|\ \ \ \ | |/ / /
| * | | Prevent use after free in fpm_event_epoll_waitMaksim Nikulin2019-07-222-1/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | epoll event backend does not guarantee that child input/output events are reported before SIGCHILD due to finished worker. While a bunch of events received by epoll is being processed, child-related structures may be removed before dispatching of an I/O event for the same child. The result may be attempt to access to memory region allocated for another purpose, segfault of the master process, and unavailable web sites. Postpone processing of SIGCHILD events till other events in the same bunch are processed. Fix Bug #62418 php-fpm master process crashes Fix Bug #65398 Race condition between SIGCHLD and child stdout/stderr event leads to segfault Fix Bug #75112 php-fpm crashing, hard to reproduce Fix Bug #77114 php-fpm master segfaults in fpm_event_epoll_wait/fpm_event_fire Fix Bug #77185 Use-after-free in FPM master event handling
* | | | Merge branch 'PHP-7.3' into PHP-7.4George Wang2019-07-211-62/+62
|\ \ \ \ | |/ / /
| * | | Merge branch 'PHP-7.2' into PHP-7.3George Wang2019-07-211-62/+62
| |\ \ \ | | |/ /
| | * | Checked in LiteSpeed SAPI 7.5, addressed two main problems in "clean ↵George Wang2019-07-201-62/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | shutdown" introduced in 7.4.3, 1. falls in an infinite loop because PHP engine's inconsistent state, now override the ITIMER_PROF to 0.1 second, clean shutdown must finish before that. 2. generate too much error log, we completely disable "error_reporting" before calling php_request_shutdown().
* | | | Deprecate alternative array access syntaxrjhdby2019-07-191-15/+15
| | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/deprecate_curly_braces_array_access
* | | | Remove duplicate socklen_t checkPeter Kokot2019-07-181-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | - Use Autoconf's default AC_CHECK_TYPES Closes GH-4418
* | | | Avoid double buffering in Zend streamsNikita Popov2019-07-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable buffering in PHP streams, to avoid storing and copying the file contents twice. This will call stream_set_option() on custom stream wrapper as well, so the method needs to be implemented to avoid a warning.
* | | | Remove ZEND_HANDLE_MAPPEDNikita Popov2019-07-161-3/+0
| | | | | | | | | | | | | | | | | | | | The buf/len members are now simply used in addition to the main stream, without changing the handle kind.
* | | | Drop free_filename field from zend_file_handleNikita Popov2019-07-162-6/+0
| | | | | | | | | | | | | | | | free_filename was always zero.
* | | | Introduce zend_stream_init_filename()Nikita Popov2019-07-164-25/+5
| | | | | | | | | | | | | | | | Avoid more ad-hoc initialization of zend_file_handle structures.
* | | | Introduce zend_stream_init_fp() APINikita Popov2019-07-163-22/+8
| | | | | | | | | | | | | | | | | | | | Reduce the amount of code that mucks around with zend_file_handle initialization.
* | | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-07-162-0/+17
|\ \ \ \ | |/ / /