1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

Private files saved on Unix should have mode 0600, not 0700. They're

generally private-key files, which have no need to be executable.

[originally from svn r9321]
This commit is contained in:
Simon Tatham 2011-10-02 14:16:08 +00:00
parent a27605c784
commit 6cfe48cde4

View File

@ -174,7 +174,7 @@ FILE *f_open(const Filename *filename, char const *mode, int is_private)
int fd; int fd;
assert(mode[0] == 'w'); /* is_private is meaningless for read, assert(mode[0] == 'w'); /* is_private is meaningless for read,
and tricky for append */ and tricky for append */
fd = open(filename->path, O_WRONLY | O_CREAT | O_TRUNC, 0700); fd = open(filename->path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (fd < 0) if (fd < 0)
return NULL; return NULL;
return fdopen(fd, mode); return fdopen(fd, mode);