Added a check to template.py that makes sure it doesn't run as root.

This commit is contained in:
Jeremy Fincher 2003-09-29 06:12:41 +00:00
parent 29fd291a5b
commit d88b7e94ca

View File

@ -35,12 +35,18 @@ customized startup files for bots.
""" """
import re import re
import os
import sys import sys
if sys.version_info < (2, 3, 0): if sys.version_info < (2, 3, 0):
sys.stderr.write('This program requires Python >= 2.3.0\n') sys.stderr.write('This program requires Python >= 2.3.0\n')
sys.exit(-1) sys.exit(-1)
if os.name == 'posix':
if os.getuid() == 0 or os.geteuid() == 0:
sys.stderr.write('Dude, don\'t even try to run this as root.\n')
sys.exit(-1)
import time import time
import optparse import optparse