stderr & win32 admin check

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема stderr & win32 admin check
Дата
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE34BC69@algol.sollentuna.se
обсуждение исходный текст
Ответы Re: stderr & win32 admin check  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Per previous patch, win32 required the check for admin privs to be moved
from main.c into postmaster.c, because elog was not available at this
time. While working on fixing that all the way (moving the unix one as
well), I realised this wasn't good, and did it this way instead:

* Created function write_stderr(const char *fmt, ...), used before elog
can be used. This function will write to stderr on unix and on win32
fconsole. It will write to the eventlog on win32 when running as a
service.
* Changed all (most? I think I got all) fprintf(stderr,...) to use this
function instead. That way, we gain the ability to put all the other
preivously-stderr-messages to the eventlog as well.
* This also removes postmaster_error(), since it's mostly duplicate code
with write_stderr().

This patch implements this, as well as adds the win32 check for admin
privs to main.c. Attached file security.c goes in backend/port/win32.

The patch makes the "if user is admin" check on win32 abort startup,
similar to unix. I know several people have said they think this is
wrong, since the last discussion. So if someone wants to re-open that
discussion, go ahead :-) The behaviour can easily be adapted (just
remove an exit(1) at a later date changing the message to a warning).

//Magnus


 <<stderr.patch>>

Вложения

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Translation updates for 7.4/7.5: postgres-ru.po
Следующее
От: Tom Lane
Дата:
Сообщение: Re: stderr & win32 admin check