Commit Graph

137 Commits

Author SHA1 Message Date
Christoph M. Becker
f578d57ee9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79470: PHP incompatible with 3rd party file system on demand
2020-04-27 09:32:02 +02:00
Christoph M. Becker
a2ed731fa5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79470: PHP incompatible with 3rd party file system on demand
2020-04-27 09:31:38 +02:00
Christoph M. Becker
29968d8f99 Fix #79470: PHP incompatible with 3rd party file system on demand
We add support for Activision HSM (`IO_REPARSE_TAG_ACTIVISION_HSM`) and
VFS for Git (`IO_REPARSE_TAG_PROJFS`).  The latter fixes bug #78784.
2020-04-27 09:30:57 +02:00
Nikita Popov
97cb81ead5 Remove HAVE_REALPATH checks
We do not actually use realpath(), but a custom implementation.
Make sure the realpath() function is always available.

Closes GH-5290.
2020-03-26 11:46:00 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Christoph M. Becker
3775d47eee Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78220: Can't access OneDrive folder
2019-08-19 19:58:45 +02:00
Christoph M. Becker
5e19f1d458 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78220: Can't access OneDrive folder
2019-08-19 19:57:22 +02:00
Christoph M. Becker
81f52158b4 Fix #78220: Can't access OneDrive folder
As of Windows 1903, when the OneDrive on-demand feature is enabled, the
OneDrive folder is reported as reparse point by `FindFirstFile()`, but
trying to get information about the reparse point using
`DeviceIoControl()` fails with `ERROR_NOT_A_REPARSE_POINT`.  We work
around this problem by falling back to `GetFileInformationByHandle()`
if that happens, but only if the reparse point is reported as cloud
reparse point, and only if PHP is running on Windows 1903 or later.

The patch has been developed in collaboration with ab@php.net.

We should keep an eye on the somewhat quirky OneDrive behavior, since
it might change again in a future Windows release.
2019-08-19 19:55:35 +02:00
Dmitry Stogov
9499484ed2 Implemented a faster way to access predefined TSRM resources - CG(), EG(), etc. 2019-03-14 03:01:01 +03:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Anatol Belski
1f4a04fb3f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77484 Zend engine crashes when calling realpath in invalid working dir
2019-01-19 02:39:42 +01:00
Anatol Belski
8b20e7b68b Fixed bug #77484 Zend engine crashes when calling realpath in invalid working dir 2019-01-19 02:36:51 +01:00
Anatol Belski
f44d53bb4a Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77317 __DIR__, __FILE__, realpath() reveal physical path for subst virtual drive
2018-12-26 13:05:46 +01:00
Anatol Belski
199914b42d Fixed bug #77317 __DIR__, __FILE__, realpath() reveal physical path for subst virtual drive
Keep compatibility with 7.2 and below which better comply with
realpath(3). This might have been fixable another way, say by checking
of QueryDosDevice or alike, sadly that comes with a huge performance
impact. The new internal realpath API is kept available so is
usable when bind or network mount or other OS specific realpath
variants are needed. If not used by default, a userspace function for
this specific case might be considered to be offered in next minor.
2018-12-26 12:59:00 +01:00
Gabriel Caruso
cdd8368d6f Clean up unnecessary ternary expressions and simplify some returns
- Simplify conditions
- Use ZEND_HASH_APPLY_* instead of hard-coded booleans
- Use ZEND_NORMALIZE_BOOL
- Drop sign in favor of ZEND_NORMALIZE_BOOL
2018-12-03 01:22:14 +01:00
Zeev Suraski
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Zeev Suraski
54dc07f3dc Update email addresses. We're still @Zend, but future proofing it... 2018-11-01 17:20:07 +02:00
Anatol Belski
91c905e83c Refactor php_sys_readlink
Also move the implementation into win32 where it belongs
2018-10-03 18:56:55 +02:00
Anatol Belski
44fa6be16e Set correct error code and adapt test 2018-09-17 17:19:39 +02:00
Anatol Belski
decdca664e Fix error setting, both errors are needed 2018-09-17 13:34:52 +02:00
Anatol Belski
e42e8b1051 Refactor stat implementation
- move relevant parts into win32
- general cleanup
- use Windows API and fallback to POSIX
- improve filetime to timestamp conversion
- improve stat/fsat
- handle ino by using file index
- handle st_dev by using volume serial number

The inode implementation is based on file indexes from NTFS. On 32-bit,
fake inodes are shown, that may lead to unexpeted results. 64-bit
implementation is most reliable.
2018-08-26 22:30:06 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Anatol Belski
18750a2238 Eliminate cast 2018-03-19 11:44:27 +01:00
Anatol Belski
397d40cdd7 Mark non exported symbol as static 2018-03-17 21:17:47 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Anatol Belski
32db45ca54 Drop unused code 2017-12-15 14:58:43 +01:00
Anatol Belski
f3f6cd24e9 Modernize realpath and integrate quick variant into virtual_file_ex
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.
2017-12-15 13:23:34 +01:00
Anatol Belski
17d621e7d3 Allow delete-sharing mode for CreateFile by default
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.
2017-12-08 18:14:20 +01:00
Anatol Belski
80d6eb6806 Fix unsigned comparisons and remove dead code
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
2017-11-17 22:38:44 +01:00
Anatol Belski
61259d692e Merge branch 'PHP-7.2'
* 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
2017-11-08 12:01:39 +01:00
Anatol Belski
01c70cc98b Merge branch 'PHP-7.1' into PHP-7.2
* 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
2017-11-08 12:00:30 +01:00
Anatol Belski
d36e793c93 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #75384 PHP seems incompatible with OneDrive files on demand
  Fixed ext/date tests due to changes in Olson database
2017-11-08 11:54:18 +01:00
Anatol Belski
c6720e2f45 Fixed #75384 PHP seems incompatible with OneDrive files on demand 2017-11-08 11:52:42 +01:00
Anatol Belski
be62d5fc19 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix datatype
2017-10-11 09:00:32 +02:00
Anatol Belski
53169dc480 Fix datatype 2017-10-11 08:58:59 +02:00
Anatol Belski
beb9295790 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #75063
2017-08-14 00:53:33 +02:00
Anatol Belski
0a2a136111 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75063
2017-08-14 00:51:47 +02:00
Anatol Belski
3069ad8dd1 Fixed bug #75063 2017-08-14 00:44:19 +02:00
Anatol Belski
827284ec36 fix up porting mistakes 2017-07-27 23:38:04 +02:00
Anatol Belski
49d9b3013f Move cwd_state and path related routines to size_t
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
2017-07-27 20:11:21 +02:00
Anatol Belski
6a010ad492 Avoid unnecessary string copy
which is the case when there's no impersonation.
2017-04-27 16:03:12 +02:00
Anatol Belski
24ae881080 get rid of two strlen calls 2017-04-27 15:41:09 +02:00
Anatol Belski
ad4ef13c5d Switch to FindFirstFileEx with basic info level
That omits querying of short names, thus improving perf.
2017-04-07 21:15:37 +02:00
Anatol Belski
936e341b5e missing bits for php_sys_stat_ex so everything is handled with wide chars
rename to pathw_len
2017-04-03 17:39:15 +02:00
Anatol Belski
f02b4d575f Merge branch 'PHP-7.1'
* PHP-7.1:
  fix possible out of bounds buffer access
2017-04-03 15:22:59 +02:00
Anatol Belski
3438e62b30 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix possible out of bounds buffer access
2017-04-03 15:22:04 +02:00
Anatol Belski
feeb35e438 fix possible out of bounds buffer access 2017-04-03 15:20:32 +02:00
Nikita Popov
edcabf6d07 Drop unnecessary allocator return value checks 2017-03-13 22:07:15 +01:00