]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/winsftp.c
Log when -restrict-acl is in use.
[PuTTY.git] / windows / winsftp.c
index 60551c99c295d4dafb70fb64e385513d2deeb369..437ef439d0c23651cb2f7bee8ad8be79350b1359 100644 (file)
@@ -8,6 +8,7 @@
 #include "psftp.h"
 #include "ssh.h"
 #include "int64.h"
+#include "winsecur.h"
 
 char *get_ttymode(void *frontend, const char *mode) { return NULL; }
 
@@ -243,7 +244,7 @@ int seek_file(WFile *f, uint64 offset, int whence)
 uint64 get_file_posn(WFile *f)
 {
     uint64 ret;
-    LONG lo, hi;
+    LONG lo, hi = 0;
 
     lo = SetFilePointer(f->h, 0L, &hi, FILE_CURRENT);
     ret.lo = lo;
@@ -746,23 +747,11 @@ char *ssh_sftp_get_cmdline(const char *prompt, int no_fds_ok)
     return ctx->line;
 }
 
-void platform_psftp_post_option_setup(void)
+void platform_psftp_pre_conn_setup(void)
 {
-#if !defined UNPROTECT && !defined NO_SECURITY
-    /*
-     * 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);
-        }
+    if (restricted_acl) {
+       logevent(NULL, "Running with restricted process ACL");
     }
-#endif
 }
 
 /* ----------------------------------------------------------------------
@@ -772,6 +761,8 @@ int main(int argc, char *argv[])
 {
     int ret;
 
+    dll_hijacking_protection();
+
     ret = psftp_main(argc, argv);
 
     return ret;