mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Check that SID is enabled while checking for Windows admin privileges.
Magnus
This commit is contained in:
parent
3ac1ac58cc
commit
eb6d1270f1
@ -6,7 +6,7 @@
|
|||||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/port/win32/security.c,v 1.9 2005/10/15 02:49:23 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/port/win32/security.c,v 1.10 2006/02/10 21:52:21 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -78,8 +78,8 @@ pgwin32_is_admin(void)
|
|||||||
|
|
||||||
for (x = 0; x < Groups->GroupCount; x++)
|
for (x = 0; x < Groups->GroupCount; x++)
|
||||||
{
|
{
|
||||||
if (EqualSid(AdministratorsSid, Groups->Groups[x].Sid) ||
|
if ((EqualSid(AdministratorsSid, Groups->Groups[x].Sid) && (Groups->Groups[x].Attributes & SE_GROUP_ENABLED)) ||
|
||||||
EqualSid(PowerUsersSid, Groups->Groups[x].Sid))
|
(EqualSid(PowerUsersSid, Groups->Groups[x].Sid) && (Groups->Groups[x].Attributes & SE_GROUP_ENABLED)))
|
||||||
{
|
{
|
||||||
success = TRUE;
|
success = TRUE;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user