Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U
Date
Msg-id 200208301512.g7UFCY401136@candle.pha.pa.us
Whole thread Raw
In response to Re: [7.3devl] Using PGPASSWORDFILE with psql requires -U  (Alvaro Herrera <alvherre@atentus.com>)
List 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@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: contrib features during beta period
Next
From: Tom Lane
Date:
Subject: Re: Accessing original TupleDesc from SRF