Hi All,

I know that the whole "id" thing in initdb is a can of worms.
We have pg_id but we don't want to use it, every system has 
a different version/variety of whoami/"who am i"/id.

We don't need/want to use the unix ID of the user, but we do
when we can. The whole thing is a mess!!

One thing we need to do is change the default, "if all else
fails" id from 0 to something else, as 0 is specifically 
disallowed and causes an "Abort" in postgres when bootstrapping.

Here's a patch to set it to 1. ( failing any better suggestion)

Keith.

*** ./src/bin/initdb/initdb.sh.orig     Wed Jan 19 08:58:13 2000
--- ./src/bin/initdb/initdb.sh  Wed Jan 19 10:02:44 2000
***************
*** 129,135 ****
  #       fail, and in that case the argument _must_ be the name of the 
effective
  #       user.
  POSTGRES_SUPERUSERNAME="$EffectiveUser"
! POSTGRES_SUPERUSERID="`id -u 2>/dev/null || echo 0`"
  
  while [ "$#" -gt 0 ]
  do
--- 129,135 ----
  #       fail, and in that case the argument _must_ be the name of the 
effective
  #       user.
  POSTGRES_SUPERUSERNAME="$EffectiveUser"
! POSTGRES_SUPERUSERID="`id -u 2>/dev/null || echo 1`"
  
  while [ "$#" -gt 0 ]
  do


Wed, 19 Jan 2000 23:41:21 +0000 (GMT)
Keith Parks <emkxp01@mtcc.demon.co.uk>
initdb problems on Solaris
Keith Parks <emkxp01@mtcc.demon.co.uk> writes:
> One thing we need to do is change the default, "if all else
> fails" id from 0 to something else, as 0 is specifically 
> disallowed and causes an "Abort" in postgres when bootstrapping.

Actually, I see no reason why the superuser's Postgres ID number
shouldn't default to 0.  If there's code in there to reject that,
isn't it doing the wrong thing?

The postmaster and backend can and should refuse to run with an
effective Unix userid of 0 (root), but that doesn't mean that
a Postgres ID of 0 is insecure, does it?

			regards, tom lane

Wed, 19 Jan 2000 19:05:27 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] initdb problems on Solaris 
On Wed, 19 Jan 2000, Keith Parks wrote:

> Hi All,
> 
> I know that the whole "id" thing in initdb is a can of worms.
> We have pg_id but we don't want to use it, every system has 
> a different version/variety of whoami/"who am i"/id.
> 
> We don't need/want to use the unix ID of the user, but we do
> when we can. The whole thing is a mess!!

Can you be more specific in regards to what doesn't work, what needs
fixing, etc.?

> 
> One thing we need to do is change the default, "if all else
> fails" id from 0 to something else, as 0 is specifically 
> disallowed and causes an "Abort" in postgres when bootstrapping.

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Thu, 20 Jan 2000 12:18:11 +0100 (MET)
Peter Eisentraut <e99re41@DoCS.UU.SE>
Re: [HACKERS] initdb problems on Solaris
Peter - 
If you're going to look at the id for initdb, please consider the
NT port as well. This may be more of a problem with cygwin than pgsql,
but pg_id didn't work correctly, and I had to hack on the initdb script
to get it to to run, with a 6.5.3 install, recently. 

Ross

On Thu, Jan 20, 2000 at 12:18:11PM +0100, Peter Eisentraut wrote:
> On Wed, 19 Jan 2000, Keith Parks wrote:
> 
> > Hi All,
> > 
> > I know that the whole "id" thing in initdb is a can of worms.
> > We have pg_id but we don't want to use it, every system has 
> > a different version/variety of whoami/"who am i"/id.
> > 
> > We don't need/want to use the unix ID of the user, but we do
> > when we can. The whole thing is a mess!!
> 
> Can you be more specific in regards to what doesn't work, what needs
> fixing, etc.?
> 

-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005


Thu, 20 Jan 2000 14:28:00 -0600
"Ross J. Reedstrom" <reedstrm@wallace.ece.rice.edu>
Re: [HACKERS] initdb problems on Solaris
On 2000-01-20, Ross J. Reedstrom mentioned:

> Peter - 
> If you're going to look at the id for initdb, please consider the
> NT port as well. This may be more of a problem with cygwin than pgsql,
> but pg_id didn't work correctly, and I had to hack on the initdb script
> to get it to to run, with a 6.5.3 install, recently. 

Oh dear, I just wrote a new pg_id thingy that fulfills all my initdb
wishes (no id, not whoami vs 'who am i', no Solaris stupidities), but
what's now? How does NT/Cygwin handle it? Don't they have a geteuid()
function? Feel free to hack up pg_id to always return 42 in that case.

-- 
Peter Eisentraut                  Sernanders vï¿½g 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



Sat, 22 Jan 2000 15:24:05 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: [HACKERS] initdb problems on Solaris