Open zhanhb opened 6 years ago
You can try :))
I'm not sure if I succeed to do it. But I only see
This submission is being processed at the moment... Please wait.
It seems I succeed to kill the judge client. http://bgcoder.com/Submissions
Good job! Can you provide us with a fix? :)
Not yet, I'm trying to find a solution fix this too.
I found one solution now.
ScopedHandle token;
CreateRestrictedToken(USER_LIMITED, INTEGRITY_LEVEL_LOW, PRIMARY, true, &token);
STARTUPINFO sa = {sizeof(sa)};
sa.lpDesktop = TEXT("Winsta0\\default"); // this line is optional if you are not running in windows service
CreateProcessAsUser(token.Get(), lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, &sa, lpProcessInformation);
// job
Without setting lpDesktop of startup info, you will get incorrect when running java in windows service.
if (!NativeMethods.CreateRestrictedToken(
processToken,
SANDBOX_INERT | DISABLE_MAX_PRIVILEGE,
?, // Disable SID
?, // all sids in the token except Users("S-1-5-32-545"), Everyone("S-1-1-0"), Interactive("S-1-5-4")
0, // Delete privilege
null, // these two are ignored if DISABLE_MAX_PRIVILEGE is specified
4, // Restricted SID
?, // Users, Everyone, restrict code("S-1-5-12"), login sid
out restrictedToken))
Hello, I think simple System.Diagnostics.Process.GetCurrentProcess().Kill(); in C# could kill Judje,but i am good man and i will not try this. (but what you will do if i succses?)
You can not allow Process.Kill method it maybe will help.And this is working.