Howdy.  Quick chump patch: if libpq finds a ~/.pgpass but can't stat
it, print something to stderr letting the user know.  If someone went
out of their way to put a .pgpass file in place, if they can't read
it, it seems worth while to alert them to the fact that it's not being
used (ex: root creates a .pgpass file but forgets to chown it).

-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        19 Jun 2003 23:56:53 -0000
@@ -2866,6 +2866,9 @@
        /* If password file cannot be opened, ignore it. */
        if (stat(pgpassfile, &stat_buf) == -1)
        {
+               fprintf(stderr,
+                               libpq_gettext("WARNING: Unable to read password file 
%s: %s\n"),
+                               pgpassfile, strerror(errno));
                free(pgpassfile);
                return NULL;
        }
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to