mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Added a check to template.py that makes sure it doesn't run as root.
This commit is contained in:
parent
29fd291a5b
commit
d88b7e94ca
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user