mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Move the restricted_acl flag into winsecur.c.
It's silly to set it at each call site of restrict_process_acl() if that function returns success! More sensible to have it be a flag in the same source file as restrict_process_acl(), set as an automatic _side effect_ of success. I've renamed the variable itself, and the global name 'restricted_acl' is now a query function that asks winsecur.c whether that operation has been (successfully) performed.
This commit is contained in:
@ -561,7 +561,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
(!p[2] || p[2] == '@' || p[2] == '&')) {
|
||||
/* &R restrict-acl prefix */
|
||||
restrict_process_acl();
|
||||
restricted_acl = true;
|
||||
p += 2;
|
||||
}
|
||||
|
||||
@ -866,7 +865,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
}
|
||||
}
|
||||
|
||||
if (restricted_acl) {
|
||||
if (restricted_acl()) {
|
||||
lp_eventlog(win_gui_logpolicy, "Running with restricted process ACL");
|
||||
}
|
||||
|
||||
@ -2224,7 +2223,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
PROCESS_INFORMATION pi;
|
||||
HANDLE filemap = NULL;
|
||||
|
||||
if (restricted_acl)
|
||||
if (restricted_acl())
|
||||
argprefix = "&R";
|
||||
else
|
||||
argprefix = "";
|
||||
|
Reference in New Issue
Block a user