]> granicus.if.org Git - postgresql/commitdiff
Check that SID is enabled while checking for Windows admin privileges.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Feb 2006 21:52:21 +0000 (21:52 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 Feb 2006 21:52:21 +0000 (21:52 +0000)
Magnus

src/backend/port/win32/security.c

index f610b8936170c15396dc6d0466cbf3b73e049bf7..2f22b07dfcd1e80e504ff49a126cfb1b63ee76e1 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
  *
  * 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++)
        {
-               if (EqualSid(AdministratorsSid, Groups->Groups[x].Sid) ||
-                       EqualSid(PowerUsersSid, Groups->Groups[x].Sid))
+               if ((EqualSid(AdministratorsSid, Groups->Groups[x].Sid) && (Groups->Groups[x].Attributes & SE_GROUP_ENABLED)) ||
+                       (EqualSid(PowerUsersSid, Groups->Groups[x].Sid) && (Groups->Groups[x].Attributes & SE_GROUP_ENABLED)))
                {
                        success = TRUE;
                        break;