if (_CreateRestrictedToken == NULL)
{
- fprintf(stderr, "WARNING: cannot create restricted tokens on this platform\n");
+ fprintf(stderr, _("%s: WARNING: cannot create restricted tokens on this platform\n"), progname);
if (Advapi32Handle != NULL)
FreeLibrary(Advapi32Handle);
return 0;
/* Open the current token to use as a base for the restricted one */
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &origToken))
{
- fprintf(stderr, "Failed to open process token: error code %lu\n", GetLastError());
+ fprintf(stderr, _("%s: could not open process token: error code %lu\n"), progname, GetLastError());
return 0;
}
SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_POWER_USERS, 0, 0, 0, 0, 0,
0, &dropSids[1].Sid))
{
- fprintf(stderr, "Failed to allocate SIDs: error code %lu\n", GetLastError());
+ fprintf(stderr, _("%s: could not to allocate SIDs: error code %lu\n"), progname, GetLastError());
return 0;
}
if (!b)
{
- fprintf(stderr, "Failed to create restricted token: error code %lu\n", GetLastError());
+ fprintf(stderr, _("%s: could not create restricted token: error code %lu\n"), progname, GetLastError());
return 0;
}
processInfo))
{
- fprintf(stderr, "CreateProcessAsUser failed: error code %lu\n", GetLastError());
+ fprintf(stderr, _("%s: could not start process for \"%s\": error code %lu\n"), progname, cmd, GetLastError());
return 0;
}
if (!CreateRestrictedProcess(cmdline, &pi))
{
- fprintf(stderr, "Failed to re-exec with restricted token: error code %lu\n", GetLastError());
+ fprintf(stderr, _("%s: could not re-exec with restricted token: error code %lu\n"), progname, GetLastError());
}
else
{
if (!GetExitCodeProcess(pi.hProcess, &x))
{
- fprintf(stderr, "Failed to get exit code from subprocess: error code %lu\n", GetLastError());
+ fprintf(stderr, _("%s: could not get exit code from subprocess: error code %lu\n"), progname, GetLastError());
exit(1);
}
exit(x);