Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit eb6d127

Browse files
committed
Check that SID is enabled while checking for Windows admin privileges.
Magnus
1 parent 3ac1ac5 commit eb6d127

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/port/win32/security.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/backend/port/win32/security.c,v 1.9 2005/10/15 02:49:23 momjian Exp $
9+
* $PostgreSQL: pgsql/src/backend/port/win32/security.c,v 1.10 2006/02/10 21:52:21 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -78,8 +78,8 @@ pgwin32_is_admin(void)
7878

7979
for (x = 0; x < Groups->GroupCount; x++)
8080
{
81-
if (EqualSid(AdministratorsSid, Groups->Groups[x].Sid) ||
82-
EqualSid(PowerUsersSid, Groups->Groups[x].Sid))
81+
if ((EqualSid(AdministratorsSid, Groups->Groups[x].Sid) && (Groups->Groups[x].Attributes & SE_GROUP_ENABLED)) ||
82+
(EqualSid(PowerUsersSid, Groups->Groups[x].Sid) && (Groups->Groups[x].Attributes & SE_GROUP_ENABLED)))
8383
{
8484
success = TRUE;
8585
break;

0 commit comments

Comments
 (0)