From aebe9b4254f752d65d441bcbcf77f1708b9ba708 Mon Sep 17 00:00:00 2001 From: "oetelaar.automatisering@gmail.com" Date: Fri, 17 May 2013 10:19:12 +0000 Subject: [PATCH] Fix file create mode in FileSink endpoint, the file should be created with default 0666 mask, this allows the user to manage permissions with umask fixes issue #74 --- darkice/trunk/src/FileSink.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/darkice/trunk/src/FileSink.cpp b/darkice/trunk/src/FileSink.cpp index 087894c..0ad17cb 100644 --- a/darkice/trunk/src/FileSink.cpp +++ b/darkice/trunk/src/FileSink.cpp @@ -217,8 +217,10 @@ FileSink :: create ( void ) throw ( Exception ) if ( isOpen() ) { return false; } - - if ( (fd = ::creat( fileName, S_IRUSR | S_IWUSR)) == -1 ) { + /* filemode default to 0666 */ + const int filemode = (S_IRUSR|S_IWUSR|S_IWGRP|S_IRGRP|S_IROTH|S_IWOTH) ; + /* create the file */ + if ( (fd = ::creat( fileName, filemode )) == -1 ) { reportEvent( 3, "can't create file", fileName, errno); return false; }