From 8c23730bde30ea9831cf3741ab14abeb71618377 Mon Sep 17 00:00:00 2001 From: Russell Smith Date: Sun, 13 Sep 2015 00:13:02 -0700 Subject: [PATCH] Fix serious issue with auth --- server/client.go | 2 +- server/cmd_server_test.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/client.go b/server/client.go index 28aca56..9d6b17f 100644 --- a/server/client.go +++ b/server/client.go @@ -88,7 +88,7 @@ func newClient(app *App) *client { c.app = app c.ldb = app.ldb - c.isAuthed = false || c.authEnabled() + c.isAuthed = false c.db, _ = app.ldb.Select(0) //use default db return c diff --git a/server/cmd_server_test.go b/server/cmd_server_test.go index e44d62d..69be285 100644 --- a/server/cmd_server_test.go +++ b/server/cmd_server_test.go @@ -25,6 +25,12 @@ func TestAuth(t *testing.T) { c2 := getTestConnAuth("password") defer c2.Close() + // Should fail doing a command as we've not authed + _, err = c2.Do("GET", "tmp_select_key") + if err.Error() != " not authenticated" { + t.Fatal("Expected authentication error:", err) + } + // Login _, err = c2.Do("AUTH", "password") if err != nil {