]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/window.c
Surround process protection with an #ifndef UNPROTECT
[PuTTY.git] / windows / window.c
index 23f98a476da825ac25a66a084a5d80a8a35aee4f..2677145fef517b0f68f50333600b3e41a5315195 100644 (file)
@@ -19,6 +19,7 @@
 #include "terminal.h"
 #include "storage.h"
 #include "win_res.h"
+#include "winsecur.h"
 
 #ifndef NO_MULTIMON
 #include <multimon.h>
@@ -390,6 +391,19 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
        return 1;
     }
 
+    /*
+     * Protect our process
+     */
+    {
+#ifndef UNPROTECT
+        char *error = NULL;
+        if (! setprocessacl(error)) {
+           logevent(NULL, "Could not restrict process ACL: %s",
+                    error);
+       }
+        sfree(error);
+#endif
+    }
     /*
      * Process the command line.
      */