1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Remove useless setuid() call, instead add a check that real and effective

userids are the same.  Per today's pghackers discussion.
This commit is contained in:
Tom Lane
2001-04-21 18:29:29 +00:00
parent 9ae6819038
commit 8407bb3c72
3 changed files with 42 additions and 22 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.83 2001/03/22 06:16:18 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.84 2001/04/21 18:29:29 tgl Exp $
*
*
*-------------------------------------------------------------------------
@ -335,16 +335,14 @@ InitPostgres(const char *dbname, const char *username)
LockDisable(true);
/*
* Set ourselves to the proper user id and figure out our postgres
* user id.
* Figure out our postgres user id. If bootstrapping, we can't
* assume that pg_shadow exists yet, so fake it.
*/
if (bootstrap)
SetSessionUserId(geteuid());
else
SetSessionUserIdFromUserName(username);
setuid(geteuid());
/*
* Unless we are bootstrapping, double-check that InitMyDatabaseInfo()
* got a correct result. We can't do this until all the