summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas2017-03-17 07:33:22 +0000
committerHeikki Linnakangas2017-03-17 07:47:09 +0000
commitf93cc335a9604614a54953eb3a842abc038dacab (patch)
treedb1b50f5cb68bf2e6e091ff86dfd8f74d329d839
parenta2e2d457d4da606e84028ec66284191a4ee565c9 (diff)
-rw-r--r--src/port/win32security.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/port/win32security.c b/src/port/win32security.c
index 0169fc3ad0..f339bba0bc 100644
--- a/src/port/win32security.c
+++ b/src/port/win32security.c
@@ -77,8 +77,8 @@ pgwin32_is_admin(void)
if (!CheckTokenMembership(NULL, AdministratorsSid, &IsAdministrators) ||
!CheckTokenMembership(NULL, PowerUsersSid, &IsPowerUsers))
{
- log_error("could not check access token membership: error code %lu\n",
- GetLastError());
+ log_error(_("could not check access token membership: error code %lu\n"),
+ GetLastError());
exit(1);
}
@@ -92,8 +92,11 @@ pgwin32_is_admin(void)
}
/*
- * We consider ourselves running as a service if
- * our token contains SECURITY_SERVICE_RID (automatically added to the
+ * We consider ourselves running as a service if one of the following is
+ * true:
+ *
+ * 1) We are running as LocalSystem (only used by services)
+ * 2) Our token contains SECURITY_SERVICE_RID (automatically added to the
* process token by the SCM when starting a service)
*
* Return values:
@@ -119,7 +122,7 @@ pgwin32_is_service(void)
if (_is_service != -1)
return _is_service;
- /* First check for local system */
+ /* First check for LocalSystem */
if (!AllocateAndInitializeSid(&NtAuthority, 1,
SECURITY_LOCAL_SYSTEM_RID, 0, 0, 0, 0, 0, 0, 0,
&LocalSystemSid))