fix comments win32-is-service-v7
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 17 Mar 2017 07:33:22 +0000 (09:33 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 17 Mar 2017 07:47:09 +0000 (09:47 +0200)
src/port/win32security.c

index 0169fc3ad0cf46a2fea2d06eebd6fdd677f5c1b2..f339bba0bcdf7d892db3420439879d06c5be0ad5 100644 (file)
@@ -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))