> > Howdy.  Quick chump patch: if libpq finds a ~/.pgpass but can't stat
> > it, print something to stderr letting the user know.
> 
> Isn't this gonna complain when the file doesn't exist at all?

*blush*  Not with the attached patch.  -sc

-- 
Sean Chittenden
Index: fe-connect.c
===================================================================
RCS file: /home/ncvs/pgsql/pgsql-server/src/interfaces/libpq/fe-connect.c,v
retrieving revision 1.248
diff -u -r1.248 fe-connect.c
--- fe-connect.c        14 Jun 2003 17:49:53 -0000      1.248
+++ fe-connect.c        20 Jun 2003 00:56:35 -0000
@@ -2883,9 +2883,14 @@
 #endif
 
        fp = fopen(pgpassfile, "r");
-       free(pgpassfile);
-       if (fp == NULL)
+       if (fp == NULL) {
+               fprintf(stderr,
+                               libpq_gettext("WARNING: Unable to read password file 
%s: %s\n"),
+                               pgpassfile, strerror(errno));
+               free(pgpassfile);
                return NULL;
+       }
+       free(pgpassfile);
 
        while (!feof(fp))
        {
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to