Fix sloppy home directory substitution in SSL tests #494
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.
The MTR test files
ssl_ca.test
andssl_crl.test
both attempt to verify the absence of a bug relating to Unix home directory substitution, which involves replacing~
as the leftmost pathname component with the value of theHOME
environment variable.However, the tests do so by replacing all occurrences of the value of
HOME
with '~' in the absolute pathMYSQL_TEST_DIR
.This causes problems on systems where the value of
HOME
is a symlink. For example, ifHOME=/home/myusername
(a symlink to/local/home/myusername
) andPWD=/local/home/myusername/MySQL
, the test will end up attempting to use nonsensical broken paths such as/local~/MySQL/*
.The solution is to ensure that the substitution occurs only at the beginning of the path, and when immediately followed by '/'.