BUG #16773: GSSAPI + Msys2/mingw64 + setenv() issue.

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: jatoba(at)gaz-is(dot)ru
Subject: BUG #16773: GSSAPI + Msys2/mingw64 + setenv() issue.
Date: 2020-12-14 16:52:08
Message-ID: 16773-c0bb1bc300bde127@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16773
Logged by: George Tarasov
Email address: jatoba(at)gaz-is(dot)ru
PostgreSQL version: 12.0
Operating system: Windows MSYS2/MINGW64
Description:

Dear hackers,

I am being engaged in PostgreSQL build process with GSSAPI support in
msys2/mingw64 environment.
Everything is good enough on REL_11_STABLE branch, but there are the
following compilation and linking errors on newer versions/branches
(12-stable, 13-stable, and 14-devel).

Errors connect with setenv() call that isn't supported in msys2/mingw64.

be-secure-gssapi.c: In function 'secure_open_gssapi':
be-secure-gssapi.c:493:3: warning: implicit declaration of function
'setenv'; did you mean 'getenv'? [-Wimplicit-function-declaration]
setenv("KRB5_KTNAME", pg_krb_server_keyfile, 1);
^~~~~~
getenv

libpq/be-secure-gssapi.o: In function `secure_open_gssapi':
D:\postgresql\src\backend\libpq/be-secure-gssapi.c:493: undefined reference
to `setenv'
collect2.exe: error: ld returned 1 exit status

I have read this [1], this [2], and this [3] and as i understood it's
recommended to use more convenient putenv() insted of setenv().
But the function setenv() is still there and the patch proposed in [3] have
not yet been approved.

Please comment
Is there a plan to clean code from setenv() call and will the proposed patch
[3] or its revised versions be applied ??
Or setenv() is our Happy Future and PG-code will stay broken for non-common
execution environments, namely those, that use, for example, GSSAPI support
in msys2/mingw64.

Also I have checked BuildFarm statuses and all mingw64-nodes build PG
without GSSAPI/KRB5 support [4].
It looks like the mingw64 platform is no longer being considered as LTS and
will be in reduced feature list in the future.
Am i right?

Thanks!

[1] https://www.postgresql.org/message-id/30119.1576538578%40sss.pgh.pa.us
[2] https://www.postgresql.org/message-id/29478.1576537771%40sss.pgh.pa.us
[3]
https://www.postgresql.org/message-id/CAEudQArtoobDWsYV300qPrg4Nms_v6DkiBiewZ9nzn+KQKd9Qw@mail.gmail.com
[4] https://buildfarm.postgresql.org/cgi-bin/show_status.pl

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephen Frost 2020-12-14 19:38:36 Re: BUG #16773: GSSAPI + Msys2/mingw64 + setenv() issue.
Previous Message Edwin Polkerman 2020-12-14 16:46:06 Re: BUG #16772: Options --disable-triggers in combination with --superuser does not have the expected result