Thread: BUG #16775: Problem building with Kerberos (--with-gssapi) support on Windows
BUG #16775: Problem building with Kerberos (--with-gssapi) support on Windows
From
PG Bug reporting form
Date:
The following bug has been logged on the website: Bug reference: 16775 Logged by: Uwe Benner Email address: uwe.benner@posteo.de PostgreSQL version: 12.5 Operating system: Windows 10 Description: Hello there! I am building postgres from source on Windows, because I need a 32bit version, and wanted to have kerberos support a.k.a. `--with-gssapi` activated. When compiling, it complains about the line 493 in file src/backend/be-secure-gssapi.c [0] ``` 493 setenv("KRB5_KTNAME", pg_krb_server_keyfile, 1); ``` which seams reasonable, since it seams to be the linux api call. Is it supposed to be the linux api or does postgres itself define a setenv function somewhere else? Is it okay to fix it like this? ``` #ifndef WIN32 setenv("KRB5_KTNAME", pg_krb_server_keyfile, 1); #else SetEnvironmentVariable("KRB5_KTNAME", pg_krb_server_keyfile); #endif ``` Or should `pg_setenv`[1] or something like tat be called instead? `putenv` would be another, more or less cross platform safe option, but it's deprecated[2] in Windows and `_putenv`/`_putenv_s` should be used instead. And another thing, can you check if the call to `SetEnvironmentVariableA` in the function `pg_setenv`[1] is right? I think it's a typo and should call `SetEnvironmentVariable`. Thanks in advance Uwe Benner [0] https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/libpq/be-secure-gssapi.c;h=5a73302b7b9ea65dc8a3d57d232d473ef54ce2c1;hb=HEAD#l493 [1] https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/bin/pg_upgrade/util.c;h=a16c794261b598326253f2665eaea9039724ac45;hb=HEAD#l246 [2] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/putenv?view=msvc-160
Re: BUG #16775: Problem building with Kerberos (--with-gssapi) support on Windows
From
Tom Lane
Date:
PG Bug reporting form <noreply@postgresql.org> writes: > I am building postgres from source on Windows, because I need a 32bit > version, and wanted to have kerberos support a.k.a. `--with-gssapi` > activated. > When compiling, it complains about the line 493 in file > src/backend/be-secure-gssapi.c [0] > 493 setenv("KRB5_KTNAME", pg_krb_server_keyfile, 1); Huh, is there suddenly some great groundswell of interest in GSSAPI on Windows? Anywhere, see near-duplicate report from earlier today: https://www.postgresql.org/message-id/flat/16773-c0bb1bc300bde127%40postgresql.org and the earlier discussions that links to. regards, tom lane
Re: BUG #16775: Problem building with Kerberos (--with-gssapi) support on Windows
From
Uwe Benner
Date:
> Am 14.12.2020 um 23:11 schrieb Tom Lane <tgl@sss.pgh.pa.us>: > > PG Bug reporting form <noreply@postgresql.org> writes: >> I am building postgres from source on Windows, because I need a 32bit >> version, and wanted to have kerberos support a.k.a. `--with-gssapi` >> activated. >> When compiling, it complains about the line 493 in file >> src/backend/be-secure-gssapi.c [0] >> 493 setenv("KRB5_KTNAME", pg_krb_server_keyfile, 1); > > Huh, is there suddenly some great groundswell of interest in > GSSAPI on Windows? Anywhere, see near-duplicate report from > earlier today: > > https://www.postgresql.org/message-id/flat/16773-c0bb1bc300bde127%40postgresql.org > > and the earlier discussions that links to. > > regards, tom lane Hah I don't think so. Anyways thanks for the link! Kind regards, Uwe Benner