Re: setuid(geteuid());? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: setuid(geteuid());?
Date
Msg-id 200104211507.f3LF7ub01938@candle.pha.pa.us
Whole thread Raw
In response to setuid(geteuid());?  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: setuid(geteuid());?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> This call
> 
> setuid(geteuid());
> 
> is found in backend/utils/init/postinit.c.  AFAICT, this does nothing.
> Anyone got an idea?

Well, from my BSD manual it says:
    The setuid() function sets the real and effective user IDs and the saved    set-user-ID of the current process to
thespecified value.  The setuid()
 

so it seems to make sure the real/saved uid matches the effective uid. 
Now, considering we don't use uid/euid distinction for anything, I agree
it is useless and should be removed.

I don't see any mention of getuid() except in odbc and pg_id.  Seems
they should be geteuid() too.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: setuid(geteuid());?
Next
From: Tom Lane
Date:
Subject: Re: setuid(geteuid());?