The following trivial patch allows the user of QuickFIX to control the
permissions of any directories created by the FileLog and FileStore
classes using their umask. This is standard behavior. The mode of a
directory created by mkdir(2) is calculated from mode & ~umask, so the
current value of 0700 makes it impossible to ever set any of the group
or other access rights.
For example, we want our directories to have mode 0755 so that support
personnel can monitor logfiles without needing to become the user that
runs the FIX engine, which can be a security issue.
Index: FileLog.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/quickfix/quickfix/src/C++/FileLog.cpp,v
retrieving revision 1.6
diff -u -b -r1.6 FileLog.cpp
--- FileLog.cpp 4 Aug 2004 00:30:02 -0000 1.6
+++ FileLog.cpp 15 Jun 2005 19:10:31 -0000
@@ -49,7 +49,7 @@
FileLog::FileLog( std::string path, const SessionID& s )
: m_sessionID( s )
{
- file_mkdir( path.c_str(), 0700 );
+ file_mkdir( path.c_str(), 0777 );
=20
if ( path.empty() ) path =3D ".";
const std::string& begin =3D
Index: FileStore.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/quickfix/quickfix/src/C++/FileStore.cpp,v
retrieving revision 1.11
diff -u -b -r1.11 FileStore.cpp
--- FileStore.cpp 21 Feb 2005 20:55:37 -0000 1.11
+++ FileStore.cpp 15 Jun 2005 19:10:31 -0000
@@ -35,7 +35,7 @@
FileStore::FileStore( std::string path, const SessionID& s )
: m_msgFile( 0 ), m_headerFile( 0 ), m_seqNumsFile( 0 ), m_sessionFile( 0 =
)
{
- file_mkdir( path.c_str(), 0700 );
+ file_mkdir( path.c_str(), 0777 );
=20
if ( path.empty() ) path =3D ".";
const std::string& begin =3D
--=20
Caleb Epstein
caleb dot epstein at gmail dot com
|