]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/winsftp.c
64-bit cleanness: use INT_PTR/UINT_PTR where appropriate.
[PuTTY.git] / windows / winsftp.c
index fa052eebffc5c5b41b201c1065c5317eafbe2c9c..572aa48c275065b7770114e176fb02f2332adf05 100644 (file)
@@ -340,14 +340,14 @@ struct WildcardMatcher {
     char *srcpath;
 };
 
-/*
- * Return a pointer to the portion of str that comes after the last
- * slash (or backslash or colon, if `local' is TRUE).
- */
-static char *stripslashes(char *str, int local)
+char *stripslashes(const char *str, int local)
 {
     char *p;
 
+    /*
+     * On Windows, \ / : are all path component separators.
+     */
+
     if (local) {
         p = strchr(str, ':');
         if (p) str = p+1;
@@ -361,7 +361,7 @@ static char *stripslashes(char *str, int local)
        if (p) str = p+1;
     }
 
-    return str;
+    return (char *)str;
 }
 
 WildcardMatcher *begin_wildcard_matching(const char *name)
@@ -733,6 +733,25 @@ char *ssh_sftp_get_cmdline(const char *prompt, int no_fds_ok)
     return ctx->line;
 }
 
+void platform_psftp_post_option_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);
+        }
+    }
+#endif
+}
+
 /* ----------------------------------------------------------------------
  * Main program. Parse arguments etc.
  */