mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-12 08:43:53 -05:00
Extend ACL-restriction to all Windows tools.
Protecting our processes from outside interference need not be limited to just PuTTY: there's no reason why the other SSH-speaking tools shouldn't have the same treatment (PSFTP, PSCP, Plink), and PuTTYgen and Pageant which handle private key material.
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
#include "putty.h"
|
||||
#include "storage.h"
|
||||
#include "tree234.h"
|
||||
#include "winsecur.h"
|
||||
|
||||
#define WM_AGENT_CALLBACK (WM_APP + 4)
|
||||
|
||||
@ -497,6 +498,22 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef UNPROTECT
|
||||
/*
|
||||
* Protect our process.
|
||||
*/
|
||||
{
|
||||
char *error = NULL;
|
||||
if (!setprocessacl(error)) {
|
||||
char *message = dupprintf("Could not restrict process ACL: %s",
|
||||
error);
|
||||
logevent(NULL, message);
|
||||
sfree(message);
|
||||
sfree(error);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (errors)
|
||||
return 1;
|
||||
|
||||
|
Reference in New Issue
Block a user