-
Notifications
You must be signed in to change notification settings - Fork 560
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
"@" symbol in directory path results in syntax error in Config_heavy.pl #22446
Comments
What do you mean by 'Set a directory path containing "@"'? |
For reasons out of my control, on our ubuntu system the user folders within the home directory are named according to the users email adress (e.g. /home/bioinformatics@zymoresearch.de/) and therefore contain the symbol "@". When using Perl in this environment, the file Config_heavy.pl contains many directory paths that all start with "/home/bioinformatics@zymoresearch.de/". These paths are not correctly recognized as literal directory paths, but the contained "@" symbol seems to lead to the issue that "@zymoresearch" is recognized as a variable and not a string. Please let me know if this is unclear still. I'll be happy to give futher details and to describe the workaround that i used to make things work for me |
I created a path with a
Then I used perl in this directory:
No errors. |
I should have recreated the bug reliably before opening the issue.
|
I downloaded a tarball of perl-5.40, unpacked it, and built it in a directory containing an
I inspected the resulting
I then installed a couple of modules with the corresponding So I agree with you that the problem is not with |
If you build and test perl from a directory whose name contains an `@` sign (such as `/tmp/hello@world/perl5`, one of the tests in `t/io/pipe.t` fails. This is because it takes the path to the perl binary (which is `/tmp/hello@world/perl5/perl` in our example) and interpolates it in double-quotes into a string that is then eval'd and run (via `fresh_perl()`). Thus the code that the interpreter in the child process sees is: $Perl = "/tmp/hello@world/perl5/perl"; which of course tries to interpolate the (non-existent) `@world` array. (Similar problems would be caused by paths containing `$` or `"` characters). Switching to single quotes, as in $Perl = '/tmp/hello@world/perl5/perl'; would fix this case, but would still be vulnerable to a path containing `'` symbols. Sidestep the problem by using `q` (to prevent variable interpolation) with a NUL byte delimiter (which cannot occur in path names). Found while investigating Perl#22446.
If you build and test perl from a directory whose name contains an `@` sign (such as `/tmp/hello@world/perl5`), one of the tests in `t/io/pipe.t` fails. This is because it takes the path to the perl binary (which is `/tmp/hello@world/perl5/perl` in our example) and interpolates it in double-quotes into a string that is then eval'd and run (via `fresh_perl()`). Thus the code that the interpreter in the child process sees is: $Perl = "/tmp/hello@world/perl5/perl"; which of course tries to interpolate the (non-existent) `@world` array. (Similar problems would be caused by paths containing `$` or `"` characters). Switching to single quotes, as in $Perl = '/tmp/hello@world/perl5/perl'; would fix this case, but would still be vulnerable to a path containing `'` symbols. Sidestep the problem by using `q` (to prevent variable interpolation) with a NUL byte delimiter (which cannot occur in path names). Found while investigating Perl#22446.
If you build and test perl from a directory whose name contains an `@` sign (such as `/tmp/hello@world/perl5`), one of the tests in `t/io/pipe.t` fails. This is because it takes the path to the perl binary (which is `/tmp/hello@world/perl5/perl` in our example) and interpolates it in double-quotes into a string that is then eval'd and run (via `fresh_perl()`). Thus the code that the interpreter in the child process sees is: $Perl = "/tmp/hello@world/perl5/perl"; which of course tries to interpolate the (non-existent) `@world` array. (Similar problems would be caused by paths containing `$` or `"` characters). Switching to single quotes, as in $Perl = '/tmp/hello@world/perl5/perl'; would fix this case, but would still be vulnerable to a path containing `'` symbols. Sidestep the problem by using `q` (to prevent variable interpolation) with a NUL byte delimiter (which cannot occur in path names). Found while investigating #22446.
Description
Using a directory path with "@" in a Ubuntu system causes a syntax error. The "@" symbol is interpreted as a variable instead of a part of the directory name.
Steps to Reproduce
Set a directory path containing "@" and attempt to use it in a Perl script.
Example path: /home/bioinformatics@example.de/miniconda3/envs/bismark/lib/perl5/5.32/core_perl/Config_heavy.pl
Expected behavior
The path should be recognized correctly, and no syntax error should occur.
perl -V output goes here
The text was updated successfully, but these errors were encountered: