From 8c76ffc087dc1f900125b8669d3460b7ea52f14c Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 22 May 2014 14:33:51 +0200 Subject: Fix permissions of newly created stream files The user's umask should prevent all the streams from being (eg) world writable. --- libcrystfel/src/stream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libcrystfel/src/stream.c') diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c index a0d849a8..fa893a30 100644 --- a/libcrystfel/src/stream.c +++ b/libcrystfel/src/stream.c @@ -863,12 +863,12 @@ Stream *open_stream_fd_for_write(int fd) } - Stream *open_stream_for_write(const char *filename) { int fd; - fd = open(filename, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR); + fd = open(filename, O_CREAT | O_TRUNC | O_WRONLY, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); if ( fd == -1 ) { ERROR("Failed to open stream.\n"); return NULL; -- cgit v1.2.3