Skip to content
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

Support RABBITMQ_HOME paths containing brackets on windows #2371

Merged
merged 1 commit into from
Jun 8, 2020
Merged

Support RABBITMQ_HOME paths containing brackets on windows #2371

merged 1 commit into from
Jun 8, 2020

Conversation

twjs76
Copy link
Contributor

@twjs76 twjs76 commented Jun 8, 2020

If the environment variable RABBITMQ_HOME contained a path with either
'(' or ')' (for example, a path under C:\Program Files (x86)), then
the script would unexpectedly exit with the error
'\some\path was unexpected at this time'. This was caused by the
parenthesis being interpreted as part of the batch 'if/else'.

Adding quotes around the arguments to the SET command fixes the problem.

Proposed Changes

This fixes a bug re-introduced in 3.8.4 which causes the rabbitmq service to fail to install on
Windows, if the installation path contains parenthesis ('(' or ')'): #1756

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating
the PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in related repositories

Further Comments

I tested by downloading the windows .zip archive, applying this fix to the script, and installing the service manually by running rabbitmq-service.bat install. Without this fix it fails, with this fix it succeeds.

If the environment variable RABBITMQ_HOME contained a path with either
'(' or ')' (for example, a path under C:\Program Files (x86)\), then
the script would unexpectedly exit with the error
'\some\path was unexpected at this time'. This was caused by the
parenthesis being interpreted as part of the batch 'if/else'.

Adding quotes around the arguments to the SET command fixes the problem.
@pivotal-issuemaster
Copy link

@twjs76 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@twjs76 Thank you for signing the Contributor License Agreement!

Copy link
Collaborator

@lukebakken lukebakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I will test this in my Windows environment.

@lukebakken lukebakken self-assigned this Jun 8, 2020
@lukebakken lukebakken added this to the 3.8.5 milestone Jun 8, 2020
@lukebakken
Copy link
Collaborator

Tested on Windows 8.1 Pro.

@lukebakken lukebakken merged commit 7337368 into rabbitmq:master Jun 8, 2020
lukebakken added a commit that referenced this pull request Jun 8, 2020
Support RABBITMQ_HOME paths containing brackets on windows

(cherry picked from commit 7337368)
@lukebakken
Copy link
Collaborator

Backported to v3.8.x

@michaelklishin
Copy link
Member

@twjs76 thank you very much 💪

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.

None yet

4 participants