From: | Thomas Munro <thomas(dot)munro(at)gmail(dot)com> |
---|---|
To: | Steve Lau <stevelauc(at)outlook(dot)com> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Replace remaining getpwuid() calls with getpwuid_r()? |
Date: | 2025-07-10 05:22:29 |
Message-ID: | CA+hUKGLH_sDExwZ8dS3hg8J6ihQwS=4HLiQP+CADXhMBNvFDbg@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Jul 10, 2025 at 5:10 PM Steve Lau <stevelauc(at)outlook(dot)com> wrote:
> Hi hackers, when reading the source code, I noticed that Postgres is still using getpwuid(), which is not thread-safe since it returns a pointer to the static memory that can be overwritten by concurrent calls. Then I searched "getpwuid" in the mailing list[1], and there was a committed patch that refactored one such usage. So maybe we can clean up the remaining getpwuid() calls?
+1, we should.
> Then I realized that Postgres does not use threads but processes, so technically IMHO getpwuid() is safe to Postgres? But that patch mentioned that[2]:
We would like to use threads, and many things like this are being
changed currently.
From | Date | Subject | |
---|---|---|---|
Next Message | vignesh C | 2025-07-10 05:41:33 | Re: A recent message added to pg_upgade |
Previous Message | Michael Paquier | 2025-07-10 05:21:38 | Re: [PATCH] PGSERVICEFILE as part of a normal connection string |