#include "psftp.h"
#include "ssh.h"
#include "int64.h"
+#include "winsecur.h"
char *get_ttymode(void *frontend, const char *mode) { return NULL; }
ret = snew(RFile);
ret->h = h;
- if (size)
- size->lo=GetFileSize(h, &(size->hi));
+ if (size) {
+ DWORD lo, hi;
+ lo = GetFileSize(h, &hi);
+ size->lo = lo;
+ size->hi = hi;
+ }
if (mtime || atime) {
FILETIME actime, wrtime;
ret = snew(WFile);
ret->h = h;
- if (size)
- size->lo=GetFileSize(h, &(size->hi));
+ if (size) {
+ DWORD lo, hi;
+ lo = GetFileSize(h, &hi);
+ size->lo = lo;
+ size->hi = hi;
+ }
return ret;
}
return -1;
}
- SetFilePointer(f->h, offset.lo, &(offset.hi), movemethod);
+ {
+ LONG lo = offset.lo, hi = offset.hi;
+ SetFilePointer(f->h, lo, &hi, movemethod);
+ }
if (GetLastError() != NO_ERROR)
return -1;
uint64 get_file_posn(WFile *f)
{
uint64 ret;
+ LONG lo, hi = 0;
- ret.hi = 0L;
- ret.lo = SetFilePointer(f->h, 0L, &(ret.hi), FILE_CURRENT);
+ lo = SetFilePointer(f->h, 0L, &hi, FILE_CURRENT);
+ ret.lo = lo;
+ ret.hi = hi;
return ret;
}
return ctx->line;
}
-void platform_psftp_post_option_setup(void)
+void platform_psftp_pre_conn_setup(void)
{
-#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);
- }
+ if (restricted_acl) {
+ logevent(NULL, "Running with restricted process ACL");
}
-#endif
}
/* ----------------------------------------------------------------------
{
int ret;
+ dll_hijacking_protection();
+
ret = psftp_main(argc, argv);
return ret;