gorcon/rcon-cli

Cannot use empty password in action mode

cheeseandcereal opened this issue · 2 comments

When connecting to an rcon server, you may legitimately want to provide an empty string for a password. This is possible in interactive mode, however in 'action' mode, an error will always be thrown if password is not specified, or even if it is with an empty string:

if ses.Password == "" {
return ErrEmptyPassword
}

This makes it impossible to connect to servers with an empty password in action mode. I would propose either adding a flag that allows an empty password, or simply not throwing this error at all since an empty password is a legitimate use-case.

If you're interested in accepting either proposal, I'm also willing to make a PR if you would like.

Empty password is unsecure. From Valve RCON protocol documentation:

If the rcon_password cvar is not set, or if it is set to empty string, all SERVERDATA_AUTH requests will be refused.

I agree with you that it's not secure, but regardless there are still servers which don't have a password set, so I still see a legitimate use-case for this since this is just a cli interacting with other servers. If the other servers have a password set, let the server auth reject rather than requiring it to be set in this tool (especially because you can provide an empty password in interactive mode already with this tool).