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);
}
}
/*
- * 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:
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))