Skip to content

Conversation

dlenski
Copy link

@dlenski dlenski commented Aug 28, 2023

The MTR test files ssl_ca.test and ssl_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 the HOME environment variable.

However, the tests do so by replacing all occurrences of the value of HOME with '~' in the absolute path MYSQL_TEST_DIR.

This causes problems on systems where the value of HOME is a symlink. For example, if HOME=/home/myusername (a symlink to /local/home/myusername) and PWD=/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 '/'.

The MTR test files ssl_ca.test and ssl_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 the `HOME` environment variable.

However, the tests do so by replacing *all* occurrences of the value
of `HOME` with '~' in the absolute path `MYSQL_TEST_DIR`.

This causes problems on systems where the value of `HOME` is a symlink.  For
example, if `HOME=/home/myusername` (a symlink to `/local/home/myusername`)
and `PWD=/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 '/'.
@dlenski
Copy link
Author

dlenski commented Aug 28, 2023

Submitted under the terms of the Amazon MySQL OCA.

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Please confirm this code is submitted under the terms of the OCA (Oracle's Contribution Agreement) you have previously signed by cutting and pasting the following text as a comment:
"I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it."
Thanks

@dlenski
Copy link
Author

dlenski commented Aug 29, 2023

I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow
bug http://bugs.mysql.com/bug.php?id=112216 for updates.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants