summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/initdb/initdb.c6
-rw-r--r--src/bin/psql/help.c4
-rw-r--r--src/bin/scripts/common.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index d85944ebfc..2d3958b5a1 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -39,7 +39,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.72 2004/12/31 22:02:59 pgsql Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.73 2005/01/08 22:51:12 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -628,11 +628,11 @@ get_id(void)
struct passwd *pw;
- pw = getpwuid(getuid());
+ pw = getpwuid(geteuid());
#ifndef __BEOS__ /* no root check on BEOS */
- if (!geteuid()) /* 0 is root's uid */
+ if (geteuid() == 0) /* 0 is root's uid */
{
fprintf(stderr,
_("%s: cannot be run as root\n"
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 2033a4bd86..1012de57d3 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.99 2005/01/01 05:43:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/help.c,v 1.100 2005/01/08 22:51:13 tgl Exp $
*/
#include "postgres_fe.h"
#include "common.h"
@@ -19,7 +19,7 @@
#include <pwd.h> /* for getpwuid() */
#endif
#include <sys/types.h> /* (ditto) */
-#include <unistd.h> /* for getuid() */
+#include <unistd.h> /* for geteuid() */
#else
#include <win32.h>
#endif
diff --git a/src/bin/scripts/common.c b/src/bin/scripts/common.c
index d11ebfd644..c84617b3ed 100644
--- a/src/bin/scripts/common.c
+++ b/src/bin/scripts/common.c
@@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.15 2004/12/31 22:03:17 pgsql Exp $
+ * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.16 2005/01/08 22:51:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,7 +27,7 @@ get_user_name(const char *progname)
#ifndef WIN32
struct passwd *pw;
- pw = getpwuid(getuid());
+ pw = getpwuid(geteuid());
if (!pw)
{
fprintf(stderr, _("%s: could not obtain information about current user: %s\n"),