From ee9288cda0d401a5ede7547c37b1057e3cfab1bd Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 26 Jul 2018 15:27:07 +0200 Subject: [SERVER] Add missing file mode to open() call --- src/server/uplink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/uplink.c b/src/server/uplink.c index cefd2ac..da63d82 100644 --- a/src/server/uplink.c +++ b/src/server/uplink.c @@ -888,7 +888,7 @@ static void uplink_addCrc32(dnbd3_connection_t *uplink) const size_t len = strlen( uplink->image->path ) + 30; char path[len]; snprintf( path, len, "%s.crc", uplink->image->path ); - const int fd = open( path, O_WRONLY | O_CREAT, 0640 ); + const int fd = open( path, O_WRONLY | O_CREAT, 0644 ); if ( fd >= 0 ) { write( fd, &masterCrc, sizeof(uint32_t) ); write( fd, buffer, bytes ); @@ -922,7 +922,7 @@ static bool uplink_reopenCacheFd(dnbd3_connection_t *link, const bool force) if ( !force ) return true; close( link->cacheFd ); } - link->cacheFd = open( link->image->path, O_WRONLY | O_CREAT ); + link->cacheFd = open( link->image->path, O_WRONLY | O_CREAT, 0644 ); return link->cacheFd != -1; } -- cgit v1.2.3-55-g7522