summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-04-06 20:17:59 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-04-06 20:17:59 +0000
commit0811c418abba433663330b10cb683d473cac3276 (patch)
tree628a1739c2a39b0c81987e9a803169c7231b511d
parentf9110f02e7483530d46eb892999d09edb131ec7f (diff)
Add a facility to allow starting as root, bin/inspircd -runasroot
if you actually specify this parameter, the daemon displays a huge warning in caps, then hangs for 5 secs to give you chance to ctrl+c if you made a mistake. If you dont ctrl+c it, it then starts normally. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6750 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/inspircd.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 8dde14e94..7266bb04f 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -301,7 +301,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
{
int found_ports = 0;
FailedPortList pl;
- int do_nofork = 0, do_debug = 0, do_nolog = 0, do_restart = 0; /* flag variables */
+ int do_nofork = 0, do_debug = 0, do_nolog = 0, do_restart = 0, do_root = 0; /* flag variables */
char c = 0;
modules.resize(255);
@@ -337,6 +337,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
{ "debug", no_argument, &do_debug, 1 },
{ "nolog", no_argument, &do_nolog, 1 },
{ "restart", no_argument, &do_restart, 1 },
+ { "runasroot", no_argument, &do_root, 1 },
{ 0, 0, 0, 0 }
};
@@ -386,7 +387,22 @@ InspIRCd::InspIRCd(int argc, char** argv)
this->XLines = new XLineManager(this);
Config->ClearStack();
Config->Read(true, NULL);
- this->CheckRoot();
+
+ if (!do_root)
+ this->CheckRoot();
+ else
+ {
+ printf("* WARNING * WARNING * WARNING * WARNING * WARNING * \n\n");
+ printf("YOU ARE RUNNING INSPIRCD AS ROOT. THIS IS UNSUPPORTED\n");
+ printf("AND IF YOU ARE HACKED, CRACKED, SPINDLED OR MUTILATED\n");
+ printf("OR ANYTHING ELSE UNEXPECTED HAPPENS TO YOU OR YOUR\n");
+ printf("SERVER, THEN IT IS YOUR OWN FAULT. IF YOU DID NOT MEAN\n");
+ printf("TO START INSPIRCD AS ROOT, TYPE ./inspircd stop NOW AND\n");
+ printf("RESTART THE IRCD AS A NORMAL USER. YOU HAVE BEEN WARNED!\n");
+ printf("\nInspIRCd starting in 5 seconds, ctrl+c to abort...");
+ sleep(5);
+ }
+
this->Modes = new ModeParser(this);
this->AddServerName(Config->ServerName);
CheckDie();