From bcab01d49219b43c3f275a1593545ccd06dbfe17 Mon Sep 17 00:00:00 2001 From: desaster Date: Mon, 12 Apr 2010 17:08:03 +0000 Subject: [PATCH] Display an error if trying to run as root, or if kippo.cfg is missing git-svn-id: https://kippo.googlecode.com/svn/trunk@102 951d7100-d841-11de-b865-b3884708a8e2 --- kippo.tac | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/kippo.tac b/kippo.tac index a9534c72..9114fe64 100644 --- a/kippo.tac +++ b/kippo.tac @@ -1,7 +1,7 @@ # Copyright (c) 2009 Upi Tamminen # See the COPYRIGHT file for more information -import sys +import sys, os if sys.platform == 'win32': import os, inspect # this is when just running on win32 @@ -13,6 +13,15 @@ from twisted.internet import reactor, defer from twisted.application import internet, service from twisted.cred import portal from twisted.conch.ssh import factory, keys + +if os.name == 'posix' and os.getuid() == 0: + print 'ERROR: You must not run kippo as root!' + sys.exit(1) + +if not os.path.exists('kippo.cfg'): + print 'ERROR: kippo.cfg is missing!' + sys.exit(1) + from kippo.core import honeypot from kippo.core.config import config