summaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-21 01:30:19 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-06-21 01:30:19 +0000
commitdf0c429e4b1d177335a23770999cf4b00dd532d6 (patch)
tree076bef29070366edfcb80bf58ef25c6d7549a903 /src/helperfuncs.cpp
parent30c6abb928c1845cc0e9ebd6308f29f0484898b9 (diff)
Apply patch from BuildSmart that fixes a few issues on Mac with the logfile path and ircdeamon user.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7397 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index f5d9aa5d9..da3fa5e1b 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -437,7 +437,11 @@ void InspIRCd::OpenLog(char** argv, int argc)
{
if (Config->logpath.empty())
{
+#ifndef DARWIN
Config->logpath = Config->MyDir + "/ircd.log";
+#else
+ Config->logpath = "/var/log/ircd.log";
+#endif
}
Config->log_file = fopen(Config->logpath.c_str(),"a+");
@@ -458,10 +462,17 @@ void InspIRCd::OpenLog(char** argv, int argc)
void InspIRCd::CheckRoot()
{
+#ifndef DARWIN
if (geteuid() == 0)
{
printf("WARNING!!! You are running an irc server as ROOT!!! DO NOT DO THIS!!!\n\n");
this->Log(DEFAULT,"Cant start as root");
+#else
+ if (geteuid() != 16)
+ {
+ printf("WARNING!!! You are not running inspircd as the ircdaemon user!!! YOU CAN NOT DO THIS!!!\n\n");
+ this->Log(DEFAULT,"Must start as user ircdaemon");
+#endif
Exit(EXIT_STATUS_ROOT);
}
}