Re: Re: BUG #13755: pgwin32_is_service not checking if SECURITY_SERVICE_SID is disabled
От | Michael Paquier |
---|---|
Тема | Re: Re: BUG #13755: pgwin32_is_service not checking if SECURITY_SERVICE_SID is disabled |
Дата | |
Msg-id | CAB7nPqREw6B-qQAOrbLZTTQ-Ug3NKX2O59WeAiP5sSWSKuJuMQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Re: BUG #13755: pgwin32_is_service not checking if SECURITY_SERVICE_SID is disabled ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>) |
Ответы |
Re: Re: BUG #13755: pgwin32_is_service not checking if
SECURITY_SERVICE_SID is disabled
|
Список | pgsql-hackers |
On Tue, Nov 8, 2016 at 1:36 PM, Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com> wrote: > From: pgsql-hackers-owner@postgresql.org >> [mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Michael Paquier >> Hm... See here: >> http://stackoverflow.com/questions/6084547/how-to-check-whether-a-proc >> ess-is-running-as-a-windows-service >> And particularly this quote: >> "No, that is not reliable because if a service is started from command line >> for example it will not have this token. " > > Is there any Microsoft document that states this? I don't think the above comment is correct, because SECURITY_SERVICE_RIDwas present when I started the service from command line with "net start". Not that I can see of... So maybe I'm just confused by this comment as it is added by the SCM itself, right? Things are this way since b15f9b08 that introduced pgwin32_is_service(). Still, by considering what you say, you definitely have a point that if postgres is started by another service running as Local System logs are going where they should not. Let's remove the check for LocalSystem but still check for SE_GROUP_ENABLED. So, without any refactoring work, isn't the attached patch just but fine? That seems to work properly for me. -- Michael
Вложения
В списке pgsql-hackers по дате отправления: