X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fhelperfuncs.cpp;h=da3fa5e1bc38f184e465e80cc893b907fa73000b;hb=df0c429e4b1d177335a23770999cf4b00dd532d6;hp=5aeabfd8b40d4f3f940b55f5613a796386f964ad;hpb=f95aa1c2c5fd3020169a45d8b06622173fd15bce;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 5aeabfd8b..da3fa5e1b 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -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; } @@ -435,9 +435,13 @@ void InspIRCd::OpenLog(char** argv, int argc) 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); } }