pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: uwe.benner@posteo.de
Subject: BUG #16775: Problem building with Kerberos (--with-gssapi) support on Windows
Date: Mon, 14 Dec 2020 21:32:17 +0000
Message-ID: <16775-aae444d3bb6f41e1@postgresql.org> (raw)

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=...
[1]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/bin/pg_upgrade/util.c;h=a16c794261b...
[2]
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/putenv?view=msvc-160



view thread (3+ messages)  latest in thread

Message-ID: <16775-aae444d3bb6f41e1@postgresql.org>
Permalink:  ../16775-aae444d3bb6f41e1@postgresql.org/
Also on:    postgresql.org/message-id/16775-aae444d3bb6f41e1@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, uwe.benner@posteo.de
  Subject: Re: BUG #16775: Problem building with Kerberos (--with-gssapi) support on Windows
  In-Reply-To: <16775-aae444d3bb6f41e1@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox