summaryrefslogtreecommitdiff
path: root/Zend/zend_virtual_cwd.c
Commit message (Collapse)AuthorAgeFilesLines
* year++Xinchen Hui2018-01-021-1/+1
|
* Drop unused codeAnatol Belski2017-12-151-13/+0
|
* Modernize realpath and integrate quick variant into virtual_file_exAnatol Belski2017-12-151-1/+69
| | | | | | | | | | | | | | | | | | | | The slower I/O as a traditional bottleneck on Windows which is the target of this patch. The recursive path resolution, while being an allround solution, is expensive when it comes to the common case. Files with proper ACLs set can be resolved in one go by usage of specific API. Those are available since Vista, so actually can be called old. Those simpler api is used for the cases where no CWD_EXPAND is requested. For the cases where ACLs are improper, the existing solution based on FindFirstFile still does good job also partially providing quirks. Cases involing reparse tags and other non local filesystems are also partially server by new APIs. The approach uses both APIs - the quick one for the common case still integrating realpath cache, and the existing one as a fallback. The tests show the I/O load drop on the realpath resolution part due to less system calls for the sub part resolution of paths. In most case it is justified, as the sub parts were otherwise cached or unused as well. The realpath() implementation in ioutil is also closer to the POSIX.
* Allow delete-sharing mode for CreateFile by defaultAnatol Belski2017-12-081-4/+16
| | | | | | This effectively allows a UNIX like semantics for deleting files with an open handle. Some OS related limitations still persist, but the Windows 95 times can be considered as definitely over.
* Fix unsigned comparisons and remove dead codeAnatol Belski2017-11-171-5/+0
| | | | | | | | | | | | | | | | Fix unsigned comparison Cleanup never executed block Fix unsigned comparison Fix unsigned comparison, diff can't be < 0 Fix unsigned comparison Fix unsigned comparison Remove dead code
* Merge branch 'PHP-7.2'Anatol Belski2017-11-081-2/+19
|\ | | | | | | | | | | | | * PHP-7.2: Fixed #75384 PHP seems incompatible with OneDrive files on demand bump versions Fixed ext/date tests due to changes in Olson database
| * Merge branch 'PHP-7.1' into PHP-7.2Anatol Belski2017-11-081-2/+19
| |\ | | | | | | | | | | | | | | | | | | * PHP-7.1: Fixed #75384 PHP seems incompatible with OneDrive files on demand bump versions Fixed ext/date tests due to changes in Olson database
| | * Merge branch 'PHP-7.0' into PHP-7.1Anatol Belski2017-11-081-2/+19
| | |\ | | | | | | | | | | | | | | | | | | | | * PHP-7.0: Fixed #75384 PHP seems incompatible with OneDrive files on demand Fixed ext/date tests due to changes in Olson database
| | | * Fixed #75384 PHP seems incompatible with OneDrive files on demandAnatol Belski2017-11-081-2/+19
| | | |
* | | | Merge branch 'PHP-7.2'Anatol Belski2017-10-111-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.2: Fix datatype
| * | | Fix datatypeAnatol Belski2017-10-111-1/+1
| | | |
* | | | Merge branch 'PHP-7.2'Anatol Belski2017-08-141-2/+12
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.2: Fixed bug #75063
| * | | Merge branch 'PHP-7.1' into PHP-7.2Anatol Belski2017-08-141-2/+12
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.1: Fixed bug #75063
| | * | Fixed bug #75063Anatol Belski2017-08-141-4/+13
| | | |
* | | | fix up porting mistakesAnatol Belski2017-07-271-3/+6
| | | |
* | | | Move cwd_state and path related routines to size_tAnatol Belski2017-07-271-56/+57
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having `int` there is no real profit in the size or speed, while unsigned improves security and overall integration. ZPP supplied strings can be then accepted directly and structs can be still handled with smaller unsigned types for size reasons, which is safe. Yet some related places are to go. basic move tsrm_realpath_r to size_t fix conditions and sync with affected places touch ocurrences of php_sys_readlink usage follow up on phar path handling remove duplicated check move zend_resolve_path and related pieces to size_t touch yet resolve path related places remove cast missing pieces missing piece yet cleanups for php_sys_readlink for ssize_t fix wrong return
* | | Avoid unnecessary string copyAnatol Belski2017-04-271-1/+3
| | | | | | | | | | | | which is the case when there's no impersonation.
* | | get rid of two strlen callsAnatol Belski2017-04-271-2/+3
| | |
* | | Switch to FindFirstFileEx with basic info levelAnatol Belski2017-04-071-1/+1
| | | | | | | | | | | | That omits querying of short names, thus improving perf.
* | | missing bits for php_sys_stat_ex so everything is handled with wide charsAnatol Belski2017-04-031-14/+12
| | | | | | | | | | | | rename to pathw_len
* | | Merge branch 'PHP-7.1'Anatol Belski2017-04-031-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.1: fix possible out of bounds buffer access
| * | Merge branch 'PHP-7.0' into PHP-7.1Anatol Belski2017-04-031-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.0: fix possible out of bounds buffer access
| | * fix possible out of bounds buffer accessAnatol Belski2017-04-031-1/+1
| | |
| | * Revert "backport 51e1da6ea1e663908302e162ced1b7a8cb5aee05 into 7.0"Anatol Belski2017-01-311-8/+1
| | | | | | | | | | | | This reverts commit 8da87563122e4d14208b2827fd6b2807578677ec.
| | * backport 51e1da6ea1e663908302e162ced1b7a8cb5aee05 into 7.0Anatol Belski2017-01-211-1/+8
| | |
| | * Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
* | | Drop unnecessary allocator return value checksNikita Popov2017-03-131-37/+0
| | |
* | | Merge branch 'PHP-7.1'Anatol Belski2017-01-241-4/+6
|\ \ \ | |/ / | | | | | | | | | * PHP-7.1: make length check more robust
| * | make length check more robustAnatol Belski2017-01-241-4/+6
| | |
* | | Merge branch 'PHP-7.1'Anatol Belski2017-01-211-6/+32
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-7.1: exclude debug code ensure the string for conversion is \0 terminated and integrade additional path length check
| * | exclude debug codeAnatol Belski2017-01-211-2/+13
| | |
| * | ensure the string for conversion is \0 terminated and integradeAnatol Belski2017-01-211-4/+19
| | | | | | | | | | | | additional path length check
* | | Merge branch 'PHP-7.1'Anatol Belski2017-01-201-3/+5
|\ \ \ | |/ / | | | | | | | | | * PHP-7.1: Fixed bug #73962 bug with symlink related to cyrillic directory
| * | Fixed bug #73962 bug with symlink related to cyrillic directoryAnatol Belski2017-01-201-3/+5
| | |
* | | Merge branch 'PHP-7.1'Anatol Belski2017-01-071-1/+2
|\ \ \ | |/ / | | | | | | | | | * PHP-7.1: fix edge case leak
| * | fix edge case leakAnatol Belski2017-01-071-1/+2
| | |
* | | Merge branch 'PHP-7.1'Anatol Belski2017-01-071-30/+22
|\ \ \ | |/ / | | | | | | | | | * PHP-7.1: Fixed bug #73877 readlink() returns garbage for UTF-8 paths
| * | Fixed bug #73877 readlink() returns garbage for UTF-8 pathsAnatol Belski2017-01-071-30/+22
| | |
| * | Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
* | | Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
| | |
* | | Path handling related refactoringsAnatol Belski2016-12-221-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Primarily related to the path handling datatypes, to avoid unnecessary casts, where possible. Also some rework to avoid code dup. Probably more places are to go, even not path related, primarily to have less casts and unsigned integers where possible. That way, we've not only less warnings and casts, but are also safer with regard to the integer overflows. OFC it's not a panacea, but still significantly reduces the vulnerability potential.
* | | reduce realpath_cache_bucket size by 8 bytes on 64-bitAnatol Belski2016-11-131-1/+1
| | | | | | | | | | | | | | | | | | This limits the path length to 64kb which is already far above the use case. In return, the whole path cache storage size is reduced by 8kb.
* | | Remove Netware supportKalle Sommer Nielsen2016-11-121-69/+7
| | | | | | | | | | | | If this does not break the Unix system somehow, I'll be amazed. This should get most of it out, apologies for any errors this may cause on non-Windows ends which I cannot test atm.
* | | remove dead codeAnatol Belski2016-10-261-51/+0
| | |
* | | reset also the cwd_length, when cwd is free'dAnatol Belski2016-10-261-1/+2
| | |
* | | Merge branch 'PHP-7.1'Christoph M. Becker2016-09-061-1/+1
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.0' into PHP-7.1Christoph M. Becker2016-09-061-1/+1
| |\ \ | | |/
| | * Merge branch 'PHP-5.6' into PHP-7.0Christoph M. Becker2016-09-061-1/+1
| | |\
| | | * Fix #73025: Heap Buffer Overflow in virtual_popen of zend_virtual_cwd.cChristoph M. Becker2016-09-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `command_length` is retrieved via strlen() and later passed to emalloc() and memcpy(), so the appropriate type is `size_t`. We don't add a regression test, because that would need to allocate a string of at least 2 GiB.
| | | * Merge branch 'PHP-5.5' into PHP-5.6Stanislav Malyshev2016-07-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-5.5: fix #72519, possible OOB using imagegif fix #72512, invalid read or write for palette image when invalid transparent index is used Apparently some envs miss SIZE_MAX Fix tests Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c Fix for bug #72558, Integer overflow error within _gdContributionsAlloc() Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE Fix bug #72562 - destroy var_hash properly Fix bug #72533 (locale_accept_from_http out-of-bounds access) Fix fir bug #72520 Fix for bug #72513 CS fix and comments with bug ID Fix for HTTP_PROXY issue. add tests for bug #72512 Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access Fixed bug #72479 - same as #72434 Conflicts: ext/bz2/bz2.c main/SAPI.c main/php_variables.c