Fix symlink to same exterior location #1167
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: #1166 must be merged first and then this PR should be rebased.
In the present code, when we have two separate links to the same file outside of /etc/pki, the real
file is copied to the location of both links. The problem with this is when the user makes changes
to the file in the future, they will have to edit both files whereas before they would only have had
to edit one of the files (since they linked to the same underlying file). Example:
fileA and fileB are separate copies of /etc/sourceFile.
This change makes it so anytime two links eventually point to the same exterior file, the first link will be copied and the second link will becone a symlinks to that copy like this:
This is the behaviour even if the second link went through several other exterior links to reach the
same sourceFile (but not if there is another interior link in between). Example:
The drawback to the end user is that, unless you trace all the way through the chain of symlinks, it
is confusing that fileA ends up being a real file and fileC ends up pointing to it. It's not
immediately obvious how the two are related.
The advantage is if the end user makes any changes to either fileA or fileC, then the changes will
be visible in both files which is the behaviour that existed on the host system.