Unportable(?) use of setenv() in secure_open_gssapi()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Unportable(?) use of setenv() in secure_open_gssapi()
Дата
Msg-id 30119.1576538578@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Unportable(?) use of setenv() in secure_open_gssapi()  (Stephen Frost <sfrost@snowman.net>)
Список pgsql-hackers
I noticed while investigating [1] that we have one single solitary
use of setenv(3) in our code base, in secure_open_gssapi().

It's been project policy since 2001 to avoid setenv(), and I notice
that src/port/win32env.c lacks support for setenv(), making it
pretty doubtful that the call has the semantics one would wish
on Windows.

Now, versions of the POSIX spec released in this century do have setenv(),
and even seem to regard it as "more standard" than putenv().  So maybe
there's a case for moving our goalposts and deciding to allow use of
setenv().  But then it seems like we'd better twiddle win32env.c to
support it; and I'm not sure back-patching such a change would be wise.

Alternatively, we could change secure_open_gssapi() to use putenv(),
at the cost of a couple more lines of code.

Thoughts?

            regards, tom lane

[1]
https://www.postgresql.org/message-id/SN2PR05MB264066382E2CC75E734492C8E3510%40SN2PR05MB2640.namprd05.prod.outlook.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: ERROR: could not resize shared memory segment...No space left on device
Следующее
От: Andres Freund
Дата:
Сообщение: reducing memory usage by using "proxy" memory contexts?