Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: readlink requires chdir for relative links #2670

Merged
merged 1 commit into from
Jan 29, 2014

Conversation

rolandwalker
Copy link
Contributor

Fixes #2650 (although there is more work to be done). The issue is that
path.readlink.exist? returned false for all relative links, because readlink
reads relative to the current working directory. This caused relative
symlinks such as /usr/bin/tar to be deleted, because package mosh identified
/usr/bin as one of its container directories.

Fixes Homebrew#2650 (although there is more work to be done).  The issue is that
path.readlink.exist? returned false for all relative links, because readlink
reads relative to the current working directory.  This caused relative
symlinks such as /usr/bin/tar to be deleted, because package mosh identified
/usr/bin as one of its container directories.

The simplest fix is not to use readlink at all, because path.exist?
will tell us what we want to know, independent of current dir.
rolandwalker added a commit that referenced this pull request Jan 29, 2014
BUGFIX: readlink requires chdir for relative links
@rolandwalker rolandwalker merged commit 98f93c4 into Homebrew:master Jan 29, 2014
@rolandwalker rolandwalker deleted the relative_readlink_safety branch January 29, 2014 14:27
@rolandwalker rolandwalker mentioned this pull request Jan 29, 2014
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
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.

Uninstalling brew-cask-installed mosh removes hundreds of symlinks in /usr/
1 participant