diff options
author | Ivan Zhakov <ivan@apache.org> | 2022-01-05 16:20:19 +0000 |
---|---|---|
committer | Ivan Zhakov <ivan@apache.org> | 2022-01-05 16:20:19 +0000 |
commit | a62332b821478b2a814834dd249c6e84bd976521 (patch) | |
tree | 41c973209bc1bb0293ee7cffb405c7fce28dc126 /shmem | |
parent | d7665e25559f4524ef6daf1741842943ff35c971 (diff) | |
download | apr-a62332b821478b2a814834dd249c6e84bd976521.tar.gz |
Fix a regression in apr_stat() for root path on Windows caused by the extended
symlink detection added in r1855949 (PR47630) [1].
See [2] for the detailed problem report and discussion.
The code before this patch performs FindFirstFile() whenever
APR_FINFO_LINK is passed. This is problematic for at least two reasons:
1) Any attempt to detect if the root is a symlink now fails because
FindFirstFile() cannot be called for the root directory
2) Any check that includes the APR_FINFO_LINK flag now calls FindFirstFile(),
which essentially is a "readdir". Previously, ordinary files could have
been processed with a much cheaper call to GetFileAttributesEx().
In other words, there is a significant performance penalty for
stat(... | APR_FINFO_LINK) in a common case.
Fix this by postponing a call to FindFirstFile() until we actually need the
file tag information to resolve the reparse point.
[1] https://bz.apache.org/bugzilla/show_bug.cgi?id=47630
[2] https://lists.apache.org/thread/18x2jb81nf6zrjsnwf1k2wwooprkp0p5
* file_io/win32/filestat.c
(apr_stat): Call FindFirstFile() only when asking for the true name with
APR_FINFO_NAME. Adjust the related check.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1896717 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'shmem')
0 files changed, 0 insertions, 0 deletions