]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
Fix segfault on 'cant open logfile' on startup, on trying to call Exit. instead just...
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index 612658d2095f34171a7b35f0d57114ab7eeddb27..7fba47699344968663157d0472715a93893d99db 100644 (file)
@@ -389,7 +389,7 @@ bool InspIRCd::IsChannel(const char *chname)
 }
 
 /* true for valid nickname, false else */
-bool InspIRCd::IsNick(const char* n)
+bool IsNickHandler::Call(const char* n)
 {
        if (!n || !*n)
                return false;
@@ -418,7 +418,7 @@ bool InspIRCd::IsNick(const char* n)
 }
 
 /* return true for good ident, false else */
-bool InspIRCd::IsIdent(const char* n)
+bool IsIdentHandler::Call(const char* n)
 {
        if (!n || !*n)
                return false;
@@ -450,11 +450,7 @@ 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+");
@@ -467,7 +463,7 @@ void InspIRCd::OpenLog(char** argv, int argc)
        if (!Config->log_file)
        {
                printf("ERROR: Could not write to logfile %s: %s\n\n", Config->logpath.c_str(), strerror(errno));
-               Exit(EXIT_STATUS_LOG);
+               exit(EXIT_STATUS_LOG);
        }
 
        this->Logger = new FileLogger(this, Config->log_file);
@@ -475,17 +471,10 @@ 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);
        }
 }