summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-02 19:03:38 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-02 19:03:38 +0000
commite877fb41803c301e28179bcd52d9912ebd37dc93 (patch)
tree810b3f6ec16c293ff864979d511a0fa89fc9d2c5
parentb0fe419fa0f83ab3755367c1803167568a11a722 (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
-rw-r--r--src/inspircd_io.cpp6
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)
{