-
Notifications
You must be signed in to change notification settings - Fork 325
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
Create ~/.ssh on Windows if it doesn't exist #1745
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1745 +/- ##
==========================================
+ Coverage 74.88% 74.89% +0.01%
==========================================
Files 82 82
Lines 4865 4868 +3
==========================================
+ Hits 3643 3646 +3
Misses 1222 1222
Continue to review full report at Codecov.
|
This is an example of how it behaved before. It just happened to work because ~/.ssh already existed:
This is after:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on using Shellwords.escape(str).sub("\\~", "~")
instead?
I think using Shellwords would be good (as in beaker should have shell escaped things from the beginning), but that's more than I want to take on right now. |
Beaker executed `mkdir -p "~/.ssh"` on Windows hosts as part of the prebuilt steps sequence. However, when using cygwin bash, the double quotes behave like single quotes, disabling tilde expansion: $ realpath "~/.ssh" /home/Administrator/~/.ssh So '~' was a directory containing the '.ssh' directory. This was never noticed because all of our VM templates already have the expected ~/.ssh directory. But if the directory doesn't exist, then later steps would fail trying to write to ~/.ssh/environment. This commit changes beaker behavior in the case that the path starts with tilde and does not contain a space, so it's safe to not quote the path. See commit 54b35b7 which double quoted unix & windows, which caused a regression that was fixed in 9288623.
Hi @ekohl I don't want to dismiss your input, but we've got a looming deadline, so I'm going to merge. Happy to chat in the future about improvements to beaker. |
No worries. I thought the inline comment was the more important one. The other has a lot of potential gotchas which is why I posed it much more as an open question. |
Beaker executed
mkdir -p "~/.ssh"
on Windows hosts as part of the prebuiltsteps sequence. However, when using cygwin bash, the double quotes behave like
single quotes, disabling tilde expansion:
$ realpath "~/.ssh"
/home/Administrator/~/.ssh
So '~' was a directory containing the '.ssh' directory. This was never noticed
because all of our VM templates already have the expected ~/.ssh directory. But
if the directory doesn't exist, then later steps would fail trying to write to
~/.ssh/environment.
This commit changes beaker behavior in the case that the path starts with tilde
and does not contain a space, so it's safe to not quote the path.
See commit 54b35b7 which double quoted unix &
windows, which caused a regression that was fixed in 9288623.