1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +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;
assert(mode[0] == 'w'); /* is_private is meaningless for read,
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)
return NULL;
return fdopen(fd, mode);