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
This commit is contained in:
desaster 2010-04-12 17:08:03 +00:00
parent a7b41cf633
commit bcab01d492
1 changed files with 10 additions and 1 deletions

View File

@ -1,7 +1,7 @@
# Copyright (c) 2009 Upi Tamminen <desaster@gmail.com>
# 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