From cca482b0061d43818e176c427616b0f6a4a86387 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sun, 8 Dec 2019 23:08:57 +0000 Subject: Improve behaviour when running as root. - Only give the annoying message about root if --runasroot is not specified. - If --runasroot is specified then assume the user knows what they are doing. - Move CheckRoot to a static function in inspircd.cpp. --- src/helperfuncs.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 70ac2f0e6..94938ef12 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -338,18 +338,6 @@ bool InspIRCd::IsSID(const std::string &str) ((str[2] >= 'A' && str[2] <= 'Z') || isdigit(str[2]))); } -void InspIRCd::CheckRoot() -{ -#ifndef _WIN32 - if (geteuid() == 0) - { - std::cout << "ERROR: You are running an irc server as root! DO NOT DO THIS!" << std::endl << std::endl; - this->Logs->Log("STARTUP", LOG_DEFAULT, "Can't start as root"); - Exit(EXIT_STATUS_ROOT); - } -#endif -} - /** A lookup table of values for multiplier characters used by * InspIRCd::Duration(). In this lookup table, the indexes for * the ascii values 'm' and 'M' have the value '60', the indexes -- cgit v1.3.1-10-gc9f91