From eb6d1270f17ad8310fce46ebe5812faa2b99c033 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 10 Feb 2006 21:52:21 +0000 Subject: [PATCH] Check that SID is enabled while checking for Windows admin privileges. Magnus --- src/backend/port/win32/security.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/port/win32/security.c b/src/backend/port/win32/security.c index f610b89361..2f22b07dfc 100644 --- a/src/backend/port/win32/security.c +++ b/src/backend/port/win32/security.c @@ -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;