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

Modified authentication functions to accept password with spaces. #79

Merged
merged 1 commit into from
Aug 15, 2017

Conversation

alexdesousa
Copy link
Contributor

Hello,

This changes would fix a minor bug I found while using exredis (Elixir Redis library that uses eredis heavily). I was having problems connecting to my Redis database always receiving this error:

** (EXIT from #PID<0.163.0>) {:connection_error, {:authentication_error, {:unexpected_data, {:ok, "-ERR wrong number of arguments for 'auth' command\r\n"}}}}

In my Elixir configuration I had:

config :exredis,
  host: "localhost",
  port: 6379,
  password: "Password with spaces.",
  db: 1,
  reconnect: :no_reconnect,
  max_queue: :infinity

To make the library work with my password, I had to change the password field of the configuration to:

password: "\"Password with spaces\""

Tracing the bug, I got to the authentication functions in eredis. When I executed the following:

{ok, C} = eredis:start_link("localhost", 6379, 1, "Password with spaces.")

I got:

** exception exit: {connection_error,{authentication_error,{unexpected_data,{ok,<<"-ERR wrong number of arguments for 'auth' command\r\n">>}}}}

TL;DR: At the moment, eredis is not accepting passwords with spaces and this pull requests is to fix this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants