1 From adf42357c9043c38d9a9b47544a1b46445bdae19 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski+openwrt@gmail.com>
3 Date: Wed, 6 Apr 2011 04:10:23 +0200
4 Subject: [PATCH] Move the root check to after config parsing
7 src/main.cpp | 27 ++++++++++++++-------------
8 1 file changed, 14 insertions(+), 13 deletions(-)
12 @@ -304,19 +304,6 @@ int main(int argc, char** argv) {
13 CUtils::PrintStatus(true, "");
17 - CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid");
18 - CUtils::PrintError("reasons for this and it can, in theory, cause great damage!");
20 - CZNC::DestroyInstance();
23 - CUtils::PrintError("You have been warned.");
24 - CUtils::PrintError("Hit CTRL+C now if you don't want to run ZNC as root.");
25 - CUtils::PrintError("ZNC will start in 30 seconds.");
30 if (!pZNC->WriteNewConfig(sConfig)) {
31 CZNC::DestroyInstance();
32 @@ -338,6 +325,20 @@ int main(int argc, char** argv) {
37 + CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid");
38 + CUtils::PrintError("reasons for this and it can, in theory, cause great damage!");
40 + CZNC::DestroyInstance();
43 + CUtils::PrintError("You have been warned.");
44 + CUtils::PrintError("Hit CTRL+C now if you don't want to run ZNC as root.");
45 + CUtils::PrintError("ZNC will start in 30 seconds.");
52 CUtils::PrintMessage("Staying open for debugging [pid: " + CString(iPid) + "]");