Commit 3f0f30d1 authored by Bruce Momjian's avatar Bruce Momjian

Add comment for getpwid() safety.

parent 80d24370
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.38 2001/01/24 03:50:06 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.39 2001/01/24 05:24:43 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -159,6 +159,7 @@ main(int argc, char *argv[]) ...@@ -159,6 +159,7 @@ main(int argc, char *argv[])
fprintf(stderr, "%s: invalid current euid", argv[0]); fprintf(stderr, "%s: invalid current euid", argv[0]);
exit(1); exit(1);
} }
/* Allocate new memory because later getpwuid() calls can overwrite it */
pw_name_persist = strdup(pw->pw_name); pw_name_persist = strdup(pw->pw_name);
exit(PostgresMain(argc, argv, argc, argv, pw_name_persist)); exit(PostgresMain(argc, argv, argc, argv, pw_name_persist));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment