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

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

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: Gordon Runkle <gar(at)integrated-dynamics(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U
Date: 2002-08-30 03:53:02
Message-ID: Pine.LNX.4.44.0208292349210.21563-100000@cm-lcon1-46-187.cm.vtr.net (view raw or flat)
Thread:
Lists: pgsql-hackers
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"


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2002-08-30 04:07:28
Subject: Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U
Previous:From: Tom LaneDate: 2002-08-30 03:51:35
Subject: Re: Reporting query duration

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