Re: be-secure-gssapi.c and auth.c with setenv() not compatible on Windows

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-05-31T00:14:36Z
Lists: pgsql-hackers

Attachments

On Sat, May 29, 2021 at 10:44:14AM -0400, Tom Lane wrote:
> What I had in mind was to *only* add pgwin32_setenv, not setenv.c.
> There's no evidence that any other modern platform lacks setenv.
> Moreover, there's no issue in these branches unless your platform
> lacks setenv yet has GSS support.

I have been finally able to poke at that, resulting in the attached.
You are right that adding only the fallback implementation for
setenv() seems to be enough.  I cannot get my environment to complain,
and the code compiles.
--
Michael

Commits

  1. Add fallback implementation for setenv()

  2. Use setenv() in preference to putenv().