#endif
#include "putty.h"
+#include "ssh.h"
#include "psftp.h"
#include "int64.h"
return NULL; /* this is a stub */
}
-void platform_get_x11_auth(char *display, int *protocol,
- unsigned char *data, int *datalen)
+void platform_get_x11_auth(struct X11Display *display, Conf *conf)
{
/* Do nothing, therefore no auth. */
}
+const int platform_uses_x11_unix_by_default = TRUE;
/*
* Default settings that are specific to PSFTP.
};
RFile *open_existing_file(char *name, uint64 *size,
- unsigned long *mtime, unsigned long *atime)
+ unsigned long *mtime, unsigned long *atime,
+ long *perms)
{
int fd;
RFile *ret;
ret = snew(RFile);
ret->fd = fd;
- if (size || mtime || atime) {
+ if (size || mtime || atime || perms) {
struct stat statbuf;
if (fstat(fd, &statbuf) < 0) {
fprintf(stderr, "%s: stat: %s\n", name, strerror(errno));
if (atime)
*atime = statbuf.st_atime;
+
+ if (perms)
+ *perms = statbuf.st_mode;
}
return ret;
char *name;
};
-WFile *open_new_file(char *name)
+WFile *open_new_file(char *name, long perms)
{
int fd;
WFile *ret;
- fd = open(name, O_CREAT | O_TRUNC | O_WRONLY, 0666);
+ fd = open(name, O_CREAT | O_TRUNC | O_WRONLY,
+ (mode_t)(perms ? perms : 0666));
if (fd < 0)
return NULL;
ret = snew(WFile);
ret->fd = fd;
+ ret->name = dupstr(name);
if (size) {
struct stat statbuf;