Skip site navigation (1) Skip section navigation (2)

Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)atentus(dot)com>
Cc: Gordon Runkle <gar(at)integrated-dynamics(dot)com>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U
Date: 2002-08-30 15:12:34
Message-ID: 200208301512.g7UFCY401136@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom has applied a patch to fix this.

---------------------------------------------------------------------------

Alvaro Herrera wrote:
> Gordon Runkle dijo: 
> 
> > I'm using the current CVS (as of ~1930 EDT, 29AUG02) on RedHat's latest
> > beta (null).  I find that I need to use the -U option when trying to use
> > psql and the new PGPASSWORDFILE variable.
> 
> Ok, in private email with Gordon I discovered that I missed by one.
> Please apply the following.  Thanks for the report.
> 
> Index: src/interfaces/libpq/fe-connect.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/interfaces/libpq/fe-connect.c,v
> retrieving revision 1.199
> diff -c -r1.199 fe-connect.c
> *** src/interfaces/libpq/fe-connect.c	2002/08/29 23:06:32	1.199
> --- src/interfaces/libpq/fe-connect.c	2002/08/30 03:52:40
> ***************
> *** 2953,2960 ****
>   				(t = pwdfMatchesString(t, dbname)) == NULL ||
>   				(t = pwdfMatchesString(t, username)) == NULL)
>   			continue;
> ! 		ret=(char *)malloc(sizeof(char)*strlen(t));
> ! 		strncpy(ret, t, strlen(t));
>   		fclose(fp);
>   		return ret;
>   	}
> --- 2953,2960 ----
>   				(t = pwdfMatchesString(t, dbname)) == NULL ||
>   				(t = pwdfMatchesString(t, username)) == NULL)
>   			continue;
> ! 		ret=(char *)malloc(sizeof(char)*(strlen(t)+1));
> ! 		strncpy(ret, t, strlen(t)+1);
>   		fclose(fp);
>   		return ret;
>   	}
> 
> -- 
> Alvaro Herrera (<alvherre[a]atentus.com>)
> "La felicidad no es ma?ana. La felicidad es ahora"
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2002-08-30 15:16:38
Subject: Re: Accessing original TupleDesc from SRF
Previous:From: Tom LaneDate: 2002-08-30 15:08:09
Subject: Re: contrib features during beta period

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group