packages/net/znc/patches/001-move_rootcheck_after_config.patch
jogo bb67d4a921 ZNC: Update to 0.098 and minor fixes
* Update ZNC to latest stable

 * Update download URI to new location

 * Add a fix for building webadmin with uClibc++ and enable it

 * Reduce build time slightly skipping the man target

 * Add myself as maintainer

Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@gmail.com>


git-svn-id: svn://svn.openwrt.org/openwrt/packages@26651 3c298f89-4303-0410-b956-a3cf2f4a3e73
2011-04-13 18:25:52 +00:00

53 lines
1.6 KiB
Diff

From 5f655f9a25a377c01cb15517859eb514628a43d4 Mon Sep 17 00:00:00 2001
From: Jonas Gorski <jonas.gorski+openwrt@gmail.com>
Date: Wed, 6 Apr 2011 04:10:23 +0200
Subject: [PATCH] Move the root check to after config parsing
---
main.cpp | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)
--- a/main.cpp
+++ b/main.cpp
@@ -194,19 +194,6 @@ int main(int argc, char** argv) {
}
#endif
- if (isRoot()) {
- CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid");
- CUtils::PrintError("reasons for this and it can, in theory, cause great damage!");
- if (!bAllowRoot) {
- delete pZNC;
- return 1;
- }
- CUtils::PrintError("You have been warned.");
- CUtils::PrintError("Hit CTRL+C now if you don't want to run ZNC as root.");
- CUtils::PrintError("ZNC will start in 30 seconds.");
- sleep(30);
- }
-
if (bMakeConf) {
if (!pZNC->WriteNewConfig(sConfig)) {
delete pZNC;
@@ -227,6 +214,20 @@ int main(int argc, char** argv) {
return 1;
}
+ if (isRoot()) {
+ CUtils::PrintError("You are running ZNC as root! Don't do that! There are not many valid");
+ CUtils::PrintError("reasons for this and it can, in theory, cause great damage!");
+ if (!bAllowRoot) {
+ delete pZNC;
+ return 1;
+ }
+ CUtils::PrintError("You have been warned.");
+ CUtils::PrintError("Hit CTRL+C now if you don't want to run ZNC as root.");
+ CUtils::PrintError("ZNC will start in 30 seconds.");
+ sleep(30);
+ }
+
+
if (bForeground) {
int iPid = getpid();
CUtils::PrintMessage("Staying open for debugging [pid: " + CString(iPid) + "]");