Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-23 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > I don't have problems sending the output to stderr myself. That's because you don't run libpq in any contexts where that behavior is inappropriate ... but there are plenty such contexts. Most GUI applications will want to trap any and all notices and pu

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-23 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Is there a TODO here? Tom has added the printf functionality already. > > We still have to do something about the fprintf(stderr) call that's in > PasswordFromFile already. What do you think of my suggestion of a > delayed notice?

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-23 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Is there a TODO here? Tom has added the printf functionality already. We still have to do something about the fprintf(stderr) call that's in PasswordFromFile already. What do you think of my suggestion of a delayed notice? rega

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-23 Thread Bruce Momjian
Is there a TODO here? Tom has added the printf functionality already. --- Tom Lane wrote: > Sean Chittenden <[EMAIL PROTECTED]> writes: > > I maintain that having a security concern in PasswordFromFile() cause > > the conn

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-23 Thread Tom Lane
Sean Chittenden <[EMAIL PROTECTED]> writes: > I maintain that having a security concern in PasswordFromFile() cause > the connection to abort as the default behavior is a bad idea. That is a legitimate concern. Doesn't seem like we have any really clean way to satisfy all the needs here. One ide

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-23 Thread Sean Chittenden
> > Those notices were sent to setderr earlier, they were already > > broken: at least now there's a ghost of a chance at the app at > > picking up those errors. > > The notice in PasswordFromFile is broken, yes, but it is a recent > addition; it has not been there long and has no seniority in my

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-23 Thread Tom Lane
Sean Chittenden <[EMAIL PROTECTED]> writes: > Those notices were sent to setderr earlier, they were already broken: > at least now there's a ghost of a chance at the app at picking up > those errors. The notice in PasswordFromFile is broken, yes, but it is a recent addition; it has not been there

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-23 Thread Tom Lane
Sean Chittenden <[EMAIL PROTECTED]> writes: > All regression tests pass with this case and no ABI or source > incompatabilities are introduced. You're still playing extremely fast and loose with that claim of "no incompatibilities introduced". This may not *directly* break an application that use

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-23 Thread Sean Chittenden
> > All regression tests pass with this case and no ABI or source > > incompatabilities are introduced. > > You're still playing extremely fast and loose with that claim of "no > incompatibilities introduced". This may not *directly* break an > application that uses PQsetNoticeProcessor, but it b

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-23 Thread Sean Chittenden
> I could envision a helper procedure, known only within libpq, that has > a signature like formatNotice(PGconn* conn, const char *fmtstring, ...) > and encapsulates the work needed to handle a format string. But I see > no reason to push that work out to client applications. I could make fnotice

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-22 Thread Sean Chittenden
> > Um, I said it would change the ABI and I said as much in my > > previous post. > > The ABI is only the smaller part of the problem; you'd be forcing > people to change their source code, in a rather nonobvious way. *sigh* This isn't worth it at this point. Having written several logging inte

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-22 Thread Tom Lane
Sean Chittenden <[EMAIL PROTECTED]> writes: > Um, I said it would change the ABI and I said as much in my previous > post. The ABI is only the smaller part of the problem; you'd be forcing people to change their source code, in a rather nonobvious way. > it is code compatible provided people aren

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-22 Thread Sean Chittenden
> > -typedef void (*PQnoticeProcessor) (void *arg, const char *message); > > +typedef void (*PQnoticeProcessor) (void *arg, const char *message, ...); > > This isn't going to happen. It would break every existing > application that uses a notice processor, since they are not > expecting to have t

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-20 Thread Tom Lane
Sean Chittenden <[EMAIL PROTECTED]> writes: > -typedef void (*PQnoticeProcessor) (void *arg, const char *message); > +typedef void (*PQnoticeProcessor) (void *arg, const char *message, ...); This isn't going to happen. It would break every existing application that uses a notice processor, since

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-20 Thread Sean Chittenden
> > Would you like me to add an interface that'd allow stderr to be > > redirected in the case of defaultNoticeProcessor()? > > No, the application is supposed to set a notice processor if it > doesn't want stuff going to stderr. I don't think that stuff needs > to be redesigned. Ehh... I'd say

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-20 Thread Tom Lane
Sean Chittenden <[EMAIL PROTECTED]> writes: > Would you like me to add an interface that'd allow stderr to be > redirected in the case of defaultNoticeProcessor()? No, the application is supposed to set a notice processor if it doesn't want stuff going to stderr. I don't think that stuff needs to

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-20 Thread Sean Chittenden
> > stderr is hooked up to the error logs under Apache, which is the > > normal error reporting mechanism. I thought about adding a test to > > see if stderr is writable, but given that better than 99% of the time > > it will be, I didn't see the point, esp since the above case regarding > > the p

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-20 Thread Tom Lane
Sean Chittenden <[EMAIL PROTECTED]> writes: > stderr is hooked up to the error logs under Apache, which is the > normal error reporting mechanism. I thought about adding a test to > see if stderr is writable, but given that better than 99% of the time > it will be, I didn't see the point, esp sinc

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-20 Thread Sean Chittenden
> > 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 > > u

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-19 Thread Sean Chittenden
> > 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 =

Re: [PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-19 Thread Tom Lane
Sean Chittenden <[EMAIL PROTECTED]> writes: > 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? regards, tom lane --

[PATCHES] Patch to be verbose about being unable to read ~/.pgpasss...

2003-06-19 Thread Sean Chittenden
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 create