|
39 | 39 | * Portions Copyright (c) 1994, Regents of the University of California
|
40 | 40 | * Portions taken from FreeBSD.
|
41 | 41 | *
|
42 |
| - * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.72 2004/12/31 22:02:59 pgsql Exp $ |
| 42 | + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.73 2005/01/08 22:51:12 tgl Exp $ |
43 | 43 | *
|
44 | 44 | *-------------------------------------------------------------------------
|
45 | 45 | */
|
@@ -628,11 +628,11 @@ get_id(void)
|
628 | 628 |
|
629 | 629 | structpasswd*pw;
|
630 | 630 |
|
631 |
| -pw=getpwuid(getuid()); |
| 631 | +pw=getpwuid(geteuid()); |
632 | 632 |
|
633 | 633 | #ifndef__BEOS__/* no root check on BEOS */
|
634 | 634 |
|
635 |
| -if (!geteuid())/* 0 is root's uid */ |
| 635 | +if (geteuid()==0)/* 0 is root's uid */ |
636 | 636 | {
|
637 | 637 | fprintf(stderr,
|
638 | 638 | _("%s: cannot be run as root\n"
|
|