vmware-archive / rvc

RVC is a Linux console UI for vSphere, built on the RbVmomi bindings to the vSphere API.
MIT License
240 stars 48 forks source link

Fixing issue with URI parsing of passwords taken from the command line. #60

Open codemonkeyjohn opened 12 years ago

codemonkeyjohn commented 12 years ago

The command-line parsing of the uri doesn't allow certain characters (/, ?, @, #, <, or >) to be used:

$ rvc root:tes/ting@vmhost Failed to parse URI "root:tes/ting@vmhost": bad component(expected user component): test#ng

To get around this, I tried to URI-encode the offending character, but got an InvalidLogin message:

$ rvc root:tes%2fting@vmhost Failed to connect to vmhost: InvalidLogin: Cannot complete login due to an incorrect user name or password.

This commit decodes the password, so the second command would work.

codemonkeyjohn commented 12 years ago

I've added tests and modified the code to allow domains in usernames, too.