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

[VMFleet] $Connectpass not escaped preventing launch script from running when special characters are included in the password. #60

Open
JosiahBradley opened this issue Apr 4, 2018 · 0 comments
Labels
vmfleet Issues related to VM Fleet

Comments

@JosiahBradley
Copy link

JosiahBradley commented Apr 4, 2018

[Note double underscore is escaped by the comment parser]

In create-vmfleet.ps1 line 163 CONNECTPASS is replaced with the raw password provided in parameter $connectpass without being escaped. This means if the password includes a character such as " the launch script inside the vm will not run due to syntax error. Proposed patch below (rough draft doesnt escape everything like ' )

$escapedpassword = "'" + $using:connectpass + "'"
gc C:\ClusterStorage\collect\control\launch-template.ps1 |% { $_ -replace 'CONNECTUSER',$using:connectuser -replace 'CONNECTPASS',$escapedpassword } > z:\users\administrator\launch.ps1

@JosiahBradley JosiahBradley changed the title $Connectpass not escaped preventing launch script from running when special characters are included in the password. [VMFleet] $Connectpass not escaped preventing launch script from running when special characters are included in the password. Apr 4, 2018
@DanPear DanPear added the vmfleet Issues related to VM Fleet label Oct 1, 2018
JosiahBradley added a commit to JosiahBradley/diskspd that referenced this issue Aug 10, 2021
This is a patch for Issue 60: microsoft#60
When using a password that replaces __CONNECTPASS__ that has special characters such as ',",* the command on line 36 no longer causes a syntax error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vmfleet Issues related to VM Fleet
Projects
None yet
Development

No branches or pull requests

2 participants