Subject: User semantics in Postgres

From: Brent Burton <[email-masked]>
Date: Fri, 2 Dec 1994 23:47:13 -0600

Hello,

I am trying to create a gateway between Postgres and HTTP and I'm
running into some problems.

To make a long story short, httpd normally runs as user nobody.  I added
nobody to the database as userid 65534 (same as unix), but postgres
later reports it as -2 (the 16-bit signed representation of 65534).
Thinking this may be the problem, I then create user stupid (uid 25)
and add stupid to the database.  In the meantime, httpd is restarted
and configured to run as stupid (so the gateway will be setuid stupid).

Neither of the above techniques worked; the monitor fails with the error:
"/usr/local/postgres/bin/monitor: could not find a valid user name"

Can somebody please explain what the monitor looks for concerning
uid/eid's?  Has anybody else solved a similar problem?

Thanks for your time and I appreciate any tips.

-bpb

[email-masked]

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]".
   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/

---

From: Alan Byrne <[email-masked]>
Date: Sat, 3 Dec 1994 13:01:15 +0000

> uid/eid's?  Has anybody else solved a similar problem?

We have developed a http/postgres system here and have had no problems once
the httpd is configured to run as a "normal" user.  Common practice is to set
up a uid and group, say www, for the httpd to run as.  This is also useful
when setting up access control.

Alan Byrne,
Projects Group Manager,
Computing Services,
University College Dublin.
http://slarti.ucd.ie/

---

From: Brent Burton <[email-masked]>
Date: Mon, 5 Dec 1994 16:02:16 -0600

Hello, again.

I recently emailed a (badly phrased) question to the list concerning
interfacing Postgres into our web.

What I didn't explain very well was that I created a special user to
work as both the httpd user, and as a postgres user.  This new special
user, then called 'stupid', failed to work.

I'd like to thank [email-masked] for the correct solution:

httpd does not set the USER or LOGNAME envariables that libpq requires.

Once I set these, my gateway worked properly.  Other gateway applications
may need USER, LOGNAME, PATH and other envariables set for correct
operation.

Thanks,
-Brent