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

This commit is contained in:
oetelaar.automatisering@gmail.com 2013-05-17 10:19:12 +00:00
parent 96a104d15e
commit aebe9b4254
1 changed files with 4 additions and 2 deletions

View File

@ -217,8 +217,10 @@ FileSink :: create ( void ) throw ( Exception )
if ( isOpen() ) { if ( isOpen() ) {
return false; return false;
} }
/* filemode default to 0666 */
if ( (fd = ::creat( fileName, S_IRUSR | S_IWUSR)) == -1 ) { 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); reportEvent( 3, "can't create file", fileName, errno);
return false; return false;
} }