diff options
Diffstat (limited to 'src/inspircd_io.cpp')
-rw-r--r-- | src/inspircd_io.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index 19f853ddb..685e84865 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -268,12 +268,16 @@ bool LoadConf(const char* filename, std::stringstream *target, std::stringstream target->str(""); errorstream->str(""); long linenumber = 1; - FILE* conf = fopen(filename,"r"); + // first, check that the file exists before we try to do anything with it if (!FileExists(filename)) { *errorstream << "File " << filename << " not found." << endl; return false; } + // Fix the chmod of the file to restrict it to the current user and group + chmod(filename,0600); + // now open it + FILE* conf = fopen(filename,"r"); char buffer[MAXBUF]; if (conf) { |