chef / chef-apply

The ad-hoc execution tool for the Chef ecosystem.
https://www.chef.sh/
Apache License 2.0
14 stars 14 forks source link

Chef-run does not warn if user and password incorrectly formatted and hang indefinitely on winrm connections #77

Open floodman23 opened 5 years ago

floodman23 commented 5 years ago

Description

Incorrectly formatted --user and --password parameters cause chef-run to attempt to connect to the target but hang indefinitely. Eg:

chef-run winrm://10.202.0.175 user timmy --user=Administrator --password=Password123
 [✔] Packaging cookbook... done!
 [✔] Generating local policyfile... exporting... done!
 [\] Applying user[timmy] from resource to target.
 |__ [\] [10.202.0.175] Connecting as Administrator...

The chef-run process then just sits there. After a lot of experimentation, removing the equals sign from the parameters allowed it to work successfully. What threw me was that the username was picked up correctly

Chef Workstation Version

0.2.41

Platform Version

Windows 10

jonsmorrow commented 5 years ago

@floodman23 Thanks for the report. Of the top of my head we probably are not parsing the equals sign correctly. Have you tried to run with it? We'll look into handling the parsing better or providing more clear documentation on the command.

Also, moving this to chef-apply.

tyler-ball commented 5 years ago

I know we had to do some specific work to support weird password Characters for Windows connections, seems like we're probably just handing a regex incorrectly somewhere