-
-
Notifications
You must be signed in to change notification settings - Fork 883
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
$location_sanitized variable present in code but unused #1006
Comments
Does this affect Puppet 4.x as well, or just 3.x with future parser? I am pretty sure we are not actively fixing new bugs for 3.x now that it's EOL. |
This issue is exposed by switching to future parser for me but effects puppet 4 as well. The code as written does not account for locations that legitimately have backslash characters in them. For example locations that use regex matching |
I'll get a pull request ready. Here it is #1007 |
Thanks! |
Just saw your comments in #1007 (was in the middle of trying to reproduce the issue in Beaker), I don't think There have been lots of changes, so let us know if you run into problems if you do upgrade. |
Title and node added to description. TL;DR $location_sanitized prior 0.3.0 was used to build the title and content of the location concat fragment. Now this variable is unused. This issue is not aimed to remove the dead code. |
Thanks for identifying and removing the unused code! |
NOTE: the initial problem this issue aimed to resolve is not longer valid. See comments and discussion in pull request.
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
What are you seeing
in resource/location.pp the line
$location_sanitized = regsubst($location_sanitized_tmp, '\\\\', '_', 'G')
will dutifully change'\'
to'_'
however~ ^/login/([\w-]+)?/?(.*)?$
is a valid nginx location and changing \ to _ breaks functionality.What behaviour did you expect instead
regsubst() was broken in 3.8 sans future parser see https://tickets.puppetlabs.com/browse/PUP-2612 so that line had no effect. However, enabling future parser results in invalid config due the sanitization working as intended originally.
Potential fix is to only do that sanitization if the location does NOT start with '~'
Output log
Any additional information you'd like to impart
The text was updated successfully, but these errors were encountered: