From 8407bb3c724fa0c64996ad42f6c31f684f48b401 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 21 Apr 2001 18:29:29 +0000 Subject: Remove useless setuid() call, instead add a check that real and effective userids are the same. Per today's pghackers discussion. --- src/backend/utils/init/postinit.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/backend/utils/init/postinit.c') diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c index 57a5dbe7126..f8775648668 100644 --- a/src/backend/utils/init/postinit.c +++ b/src/backend/utils/init/postinit.c @@ -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 -- cgit v1.2.3