]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/helperfuncs.cpp
m_testcommand deletes its command handler manually, no modules should do this. Will...
[user/henk/code/inspircd.git] / src / helperfuncs.cpp
index f8ecc3b48bde8c9cb2e3017c2c5c8ee5a7533417..da3fa5e1bc38f184e465e80cc893b907fa73000b 100644 (file)
@@ -81,7 +81,7 @@ std::string InspIRCd::GetServerDescription(const char* servername)
 
        FOREACH_MOD_I(this,I_OnGetServerDescription,OnGetServerDescription(servername,description));
 
-       if (description != "")
+       if (!description.empty())
        {
                return description;
        }
@@ -431,13 +431,17 @@ bool InspIRCd::IsIdent(const char* n)
 
 void InspIRCd::OpenLog(char** argv, int argc)
 {
-       Config->MyDir = ServerConfig::GetFullProgDir();
+       Config->MyDir = Config->GetFullProgDir();
 
        if (!*this->LogFileName)
        {
-               if (Config->logpath == "")
+               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);
        }
 }