Re: setuid(geteuid());?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: setuid(geteuid());?
Date: 2001-04-21 15:07:56
Message-ID: 200104211507.f3LF7ub01938@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 the specified 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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-04-21 15:43:02 SET SESSION AUTHORIZATION (was Re: Real/effective user)
Previous Message Peter Eisentraut 2001-04-21 15:04:34 setuid(geteuid());?