diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-02 19:03:38 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-02 19:03:38 +0000 |
commit | e877fb41803c301e28179bcd52d9912ebd37dc93 (patch) | |
tree | 810b3f6ec16c293ff864979d511a0fa89fc9d2c5 /src/inspircd_io.cpp | |
parent | b0fe419fa0f83ab3755367c1803167568a11a722 (diff) |
Config files read by the ircd are now chmod'ed 0600
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@951 e03df62e-2008-0410-955e-edbf42e46eb7
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) { |