Commit graph

172 commits

Author SHA1 Message Date
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
Anatol Belski
5b5130c4ff Revert "backport 51e1da6ea1 into 7.0"
This reverts commit 8da8756312.
2017-01-31 14:21:20 +01:00
Anatol Belski
352456031e Merge branch 'PHP-7.1'
* PHP-7.1:
  make length check more robust
2017-01-24 13:25:57 +01:00
Anatol Belski
403f352482 make length check more robust 2017-01-24 13:24:11 +01:00
Anatol Belski
8da8756312 backport 51e1da6ea1 into 7.0 2017-01-21 02:56:15 +01:00
Anatol Belski
d263f29b71 Merge branch 'PHP-7.1'
* PHP-7.1:
  exclude debug code
  ensure the string for conversion is \0 terminated and integrade additional path length check
2017-01-21 02:20:52 +01:00
Anatol Belski
51e1da6ea1 exclude debug code 2017-01-21 02:17:06 +01:00
Anatol Belski
6b6122a957 ensure the string for conversion is \0 terminated and integrade
additional path length check
2017-01-21 02:11:24 +01:00
Anatol Belski
73bfa264cc Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #73962 bug with symlink related to cyrillic directory
2017-01-20 23:47:12 +01:00
Anatol Belski
95406c878a Fixed bug #73962 bug with symlink related to cyrillic directory 2017-01-20 23:45:08 +01:00
Anatol Belski
25797535d4 Merge branch 'PHP-7.1'
* PHP-7.1:
  fix edge case leak
2017-01-07 01:17:18 +01:00
Anatol Belski
b716a1fbef fix edge case leak 2017-01-07 01:15:49 +01:00
Anatol Belski
628c5a31da Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #73877 readlink() returns garbage for UTF-8 paths
2017-01-07 01:10:56 +01:00
Anatol Belski
0f410f8087 Fixed bug #73877 readlink() returns garbage for UTF-8 paths 2017-01-07 01:09:17 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00