diff options
| author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2025-10-06 16:08:17 +0200 |
|---|---|---|
| committer | Jon Turney <jon.turney@dronecode.org.uk> | 2025-10-09 16:11:28 +0100 |
| commit | 60c67169d69577179bfe7b7f9d8c40fdb0a9b5f7 (patch) | |
| tree | 2423d7ed5452b1989fd9b2c57f24d69bcf8be63a /winsup/cygwin/fhandler/console.cc | |
| parent | d704d04a2ab61e92e105ba99d25df3f52ee653ff (diff) | |
| download | newlib-60c67169d69577179bfe7b7f9d8c40fdb0a9b5f7.zip newlib-60c67169d69577179bfe7b7f9d8c40fdb0a9b5f7.tar.gz newlib-60c67169d69577179bfe7b7f9d8c40fdb0a9b5f7.tar.bz2 | |
Cygwin: symlink_native: allow linking to `.` again
In 827743ab76 (Cygwin: symlink_native: allow linking to `..`,
2025-06-20), I fixed linking to `..` (which had inadvertently
targeted an incorrect location prior to that fix), but inadvertently
broke linking to `.` (which would now try to pass the empty string as
`lpTargetFileName` to `CreateSymbolicLinkW()`, failing with an
`ERROR_INVALID_REPARSE_DATA` which would be surfaced as "Permission
denied").
Let's fix this by special-casing an empty string as path as referring to
the current directory.
Note: It is unclear to me why the `winsymlinks:nativestrict` code path
even tries to simplify the symbolic link's target path (e.g. turn an
absolute path into a relative one). As long as it refers to a regular
Win32 file or directory, I would think that even something like
`././c` should have only the slashes converted, not the path
simplified (i.e. `.\.\c` instead of `c`). But that's a larger
discussion, and I would like to have the bug worked around swiftly.
Fixes: 827743ab76 (Cygwin: symlink_native: allow linking to `..`, 2025-06-20)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'winsup/cygwin/fhandler/console.cc')
0 files changed, 0 insertions, 0 deletions
