Revert Windows service check refactoring, and replace with a different fix.
authorHeikki Linnakangas
Fri, 24 Mar 2017 10:39:01 +0000 (12:39 +0200)
committerHeikki Linnakangas
Fri, 24 Mar 2017 10:39:20 +0000 (12:39 +0200)
commit42a60aa7f2074d1e1cd48f278a00c7d1423f2fb6
tree69cd78bd09df0a91ea4ccb39cba99251bab80b40
parent3e04d005c455153a2242c172ed61db2f0b362bc6
Revert Windows service check refactoring, and replace with a different fix.

This reverts commit 38bdba54a64bacec78e3266f0848b0b4a824132a, "Fix and
simplify check for whether we're running as Windows service". It turns out
that older versions of MinGW - like that on buildfarm member narwhal - do
not support the CheckTokenMembership() function. This replaces the
refactoring with a much smaller fix, to add a check for SE_GROUP_ENABLED to
pgwin32_is_service().

Only apply to back-branches, and keep the refactoring in HEAD. It's
unlikely that anyone is still really using such an old version of MinGW -
aside from narwhal - but let's not change the minimum requirements in
minor releases.

Discussion: https://www.postgresql.org/message-id/16609.1489773427@sss.pgh.pa.us
Patch: https://www.postgresql.org/message-id/CAB7nPqSvfu%3DKpJ%3DNX%2BYAHmgAmQdzA7N5h31BjzXeMgczhGCC%2BQ%40mail.gmail.com
src/backend/port/win32/security.c