Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

adityamandaleeka
Copy link
Member

@adityamandaleeka adityamandaleeka commented May 12, 2016

This change removes FILEGetFileNameFromSymLink, which attempted to resolve the target that a symbolic link pointed to (and would get it wrong for relative links).

It was being used in a few PAL functions for file/directory deletion and moving/renaming. For instance, deleting a symlink would delete the file it pointed to. With this change, those operations will work as expected (moving or deleting a symlink won't affect the target of the symlink).

I've also added checks for symlink handling in the PAL tests for DeleteFileAand RemoveDirectoryA.

@janvorli PTAL

Fixes #3450

@adityamandaleeka adityamandaleeka force-pushed the remove_getfilenamefromsymlink branch from 5769bad to d858698 Compare May 13, 2016 01:06
@adityamandaleeka
Copy link
Member Author

I've now also removed CorUnix::InternalDeleteFile since it was making OS X behave differently than other non-Windows platforms (using the SYS_delete syscall instead of unlink). SYS_delete doesn't seem to work with symlinks at all, and there doesn't seem to be any compelling reason to have OS X behavior be different from other platforms.

@adityamandaleeka
Copy link
Member Author

@janvorli @sergiy-k PTAL

@janvorli
Copy link
Member

Oh, I am sorry, I have thought I have already said LGTM.

@sergiy-k
Copy link

LGTM

@adityamandaleeka adityamandaleeka merged commit ec35fab into dotnet:master May 13, 2016
chakrabot pushed a commit to chakra-core/ChakraCore that referenced this pull request Aug 8, 2016
…lic links

Merge pull request #1393 from antonmes:linux

Synchronize changes made by @adityamandaleeka in dotnet/coreclr#4922

Fixes build on macOS Sierra:
`ChakraCore/pal/src/cruntime/filecrt.cpp:355:12: error: 'syscall' is deprecated: first deprecated in macOS 10.12 - syscall(2) is unsupported; please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost(). [-Werror,-Wdeprecated-declarations]`
Fishrock123 pushed a commit to Fishrock123/ChakraCore that referenced this pull request Aug 16, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…etfilenamefromsymlink

Change how PAL file I/O functions treat symbolic links

Commit migrated from dotnet/coreclr@ec35fab
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FILEGetFileNameFromSymLink in PAL does not work correctly
5 participants