Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita7a7f5c

Browse files
committed
Change rather bizarre code ordering in get_id(). This isn't strictly
cosmetic --- I'm wondering if geteuid could have side effects on errno,thus possibly resulting in a misleading error message after failure ofgetpwuid.
1 parente550763 commita7a7f5c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1994, Regents of the University of California
4343
* Portions taken from FreeBSD.
4444
*
45-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.170 2009/04/05 04:19:58 tgl Exp $
45+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.171 2009/06/03 16:17:49 tgl Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -654,8 +654,6 @@ get_id(void)
654654

655655
structpasswd*pw;
656656

657-
pw=getpwuid(geteuid());
658-
659657
if (geteuid()==0)/* 0 is root's uid */
660658
{
661659
fprintf(stderr,
@@ -666,6 +664,8 @@ get_id(void)
666664
progname);
667665
exit(1);
668666
}
667+
668+
pw=getpwuid(geteuid());
669669
if (!pw)
670670
{
671671
fprintf(stderr,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp