Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 62D0C47545C for ; Wed, 21 Aug 2002 13:03:15 -0400 (EDT) Received: from candle.pha.pa.us (216-55-132-35.dsl.san-diego.abac.net [216.55.132.35]) by postgresql.org (Postfix) with ESMTP id 3A606474E4E for ; Wed, 21 Aug 2002 13:03:14 -0400 (EDT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id g7LH35f27945; Wed, 21 Aug 2002 13:03:05 -0400 (EDT) From: Bruce Momjian Message-Id: <200208211703.g7LH35f27945@candle.pha.pa.us> Subject: Re: Newbie confused about pg_hba/md5 and password field In-Reply-To: <3D63C6E7.2030106@xigole.com> To: Scott Dunbar Date: Wed, 21 Aug 2002 13:03:05 -0400 (EDT) Cc: pgsql-interfaces@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/62 X-Sequence-Number: 3024 Sorry, this seems impossible: libpq's PQsetdbLogin() doesn't allow MD5 passwords? You shouldn't have to do anything special; it should just accept the password.PQconnectdb() has the same handling as PQsetdbLogin(). Is it possible your libpq version is older than 7.2.1? --------------------------------------------------------------------------- Scott Dunbar wrote: > Hello, > I'm pretty new to PostgreSQL in general and even newer to libpq. I am > trying to get a C program working (the authpgsql module in courier-imap) > that uses PQsetdbLogin(). I've got 7.2.1 installed and running and have > had no problem accessing it via JDBC. I have encrypted passwords in > pg_shadow and have "md5" set for the AUTH_TYPE in pg_hba.conf. However, > when using PQsetdbLogin the only way I could get a login to work was to > use unencrypted passwords in pg_shadow and change pg_hba.conf to use > "password" instead of "md5" for the database I want access to through > authpgsql. > > Why is this? Do I somehow have to md5 the clear text password before > calling PQsetdbLogin()? Does PQconnectdb() handle this and I should > update the code? I feel that the client code should be unaware of the > over the wire encryption method used and the encryption method of the > password in pg_shadow but I may be way off base on the underlying issue. > > Thanks in advance for any information. > > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073