diff options
author | Sadie Powell <sadie@witchery.services> | 2023-06-03 21:42:06 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2023-06-03 21:51:07 +0100 |
commit | 9d0a6ddc67b1e7bd0c32603b6fa90b702c13447d (patch) | |
tree | 1e4d019535c89f67e7cf54a76afabe188947c668 /src/init.cpp | |
parent | 29db25dac7aff36b4f7239a9fabd57230534cf35 (diff) | |
parent | fbf3b344740f6bd4f9337e485e35e9e8103428bc (diff) |
Merge branch '2.0' into 2.1.
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/init.cpp b/src/init.cpp index 4e39a7882..cb94d77f6 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -422,20 +422,6 @@ void Anope::Init(int ac, char **av) #ifdef _WIN32 if (!SupportedWindowsVersion()) throw CoreException(GetWindowsVersion() + " is not a supported version of Windows"); -#else - /* If we're root, issue a warning now */ - if (!getuid() && !getgid()) - { - /* If we are configured to setuid later, don't issue a warning */ - Configuration::Block *options = Config->GetBlock("options"); - if (options->Get<const Anope::string>("user").empty()) - { - std::cerr << "WARNING: You are currently running Anope as the root superuser. Anope does not" << std::endl; - std::cerr << " require root privileges to run, and it is discouraged that you run Anope" << std::endl; - std::cerr << " as the root superuser." << std::endl; - sleep(3); - } - } #endif #ifdef _WIN32 @@ -527,6 +513,20 @@ void Anope::Init(int ac, char **av) ModuleManager::LoadModule(Config->GetBlock("module", i)->Get<const Anope::string>("name"), NULL); #ifndef _WIN32 + /* If we're root, issue a warning now */ + if (!getuid() && !getgid()) + { + /* If we are configured to setuid later, don't issue a warning */ + Configuration::Block *options = Config->GetBlock("options"); + if (options->Get<const Anope::string>("user").empty()) + { + std::cerr << "WARNING: You are currently running Anope as the root superuser. Anope does not" << std::endl; + std::cerr << " require root privileges to run, and it is discouraged that you run Anope" << std::endl; + std::cerr << " as the root superuser." << std::endl; + sleep(3); + } + } + /* We won't background later, so we should setuid now */ if (Anope::NoFork) setuidgid(); |