From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Jan 18 21:30:12 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBCE9106566C for ; Wed, 18 Jan 2012 21:30:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A8F848FC15 for ; Wed, 18 Jan 2012 21:30:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0ILUCOC087803 for ; Wed, 18 Jan 2012 21:30:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0ILUCxv087800; Wed, 18 Jan 2012 21:30:12 GMT (envelope-from gnats) Resent-Date: Wed, 18 Jan 2012 21:30:12 GMT Resent-Message-Id: <201201182130.q0ILUCxv087800@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Grzegorz Blach" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A12D1065675 for ; Wed, 18 Jan 2012 21:23:56 +0000 (UTC) (envelope-from magik@roorback.net) Received: from roorback.net (ec2-50-17-44-204.compute-1.amazonaws.com [50.17.44.204]) by mx1.freebsd.org (Postfix) with ESMTP id 41BFC8FC08 for ; Wed, 18 Jan 2012 21:23:55 +0000 (UTC) Received: from silver.nine (user-109-243-218-235.play-internet.pl [109.243.218.235]) by roorback.net (Postfix) with ESMTPSA id B976922AAC for ; Wed, 18 Jan 2012 22:23:52 +0100 (CET) Message-Id: <1326921826.35522@silver.nine> Date: Wed, 18 Jan 2012 22:23:46 +0100 From: "Grzegorz Blach" To: "FreeBSD gnats submit" X-Send-Pr-Version: gtk-send-pr 0.4.9 Cc: Subject: ports/164295: databases/godis: Fixed authenticaton to database != 0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 21:30:13 -0000 >Number: 164295 >Category: ports >Synopsis: databases/godis: Fixed authenticaton to database != 0 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Wed Jan 18 21:30:12 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Grzegorz Blach >Release: FreeBSD 9.0-RELEASE amd64 >Organization: >Environment: System: FreeBSD 9.0-RELEASE #5 r229491: Wed Jan 4 19:17:56 CET 2012 magik@silver.nine:/usr/obj/usr/src/sys/SILVER >Description: Currently godis select database and then authenticate to it, this fail because auth command must be called before select. Connecting to db == 0 with authentication works, because db == 0 is default one and select command is not used in this case. >How-To-Repeat: Simple code that should work if you can connect to db == 1 with authentication. Change "secret" to your password before use. ---- begin of test.go ---- package main import ( "godis" ) func main() { db := godis.New("", 1, "secret") foo, err := db.Get("foo") if err == nil { println(foo.String()) } else { println(err.String()) } } ---- end of test.go ---- >Fix: --- godis.diff.txt begins here --- diff -ruN databases/godis/Makefile databases/godis/Makefile --- databases/godis/Makefile 2011-11-26 23:56:56.000000000 +0100 +++ databases/godis/Makefile 2012-01-18 21:37:10.577464630 +0100 @@ -7,7 +7,7 @@ PORTNAME= godis PORTVERSION= 20110803 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= databases MASTER_SITES= LOCAL/jlaffaye diff -ruN databases/godis/files/patch-conn.go databases/godis/files/patch-conn.go --- databases/godis/files/patch-conn.go 1970-01-01 01:00:00.000000000 +0100 +++ databases/godis/files/patch-conn.go 2012-01-18 22:00:03.847468110 +0100 @@ -0,0 +1,24 @@ +--- conn.go.orig 2011-09-04 22:00:03.000000000 +0200 ++++ conn.go 2012-01-18 21:31:25.000000000 +0100 +@@ -342,8 +342,8 @@ + } + + func (cc *conn) configConn(db int, password string) os.Error { +- if db != 0 { +- buf := [][]byte{[]byte("SELECT"), []byte(strconv.Itoa(db))} ++ if password != "" { ++ buf := [][]byte{[]byte("AUTH"), []byte(password)} + _, err := cc.rwc.Write(buildCmd(buf)) + + if err != nil { +@@ -356,8 +356,8 @@ + } + } + +- if password != "" { +- buf := [][]byte{[]byte("AUTH"), []byte(password)} ++ if db != 0 { ++ buf := [][]byte{[]byte("SELECT"), []byte(strconv.Itoa(db))} + _, err := cc.rwc.Write(buildCmd(buf)) + + if err != nil { --- godis.diff.txt ends here --- >Release-Note: >Audit-Trail: >Unformatted: