mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
supybot-wizard: Prevent this script from running directly in ~/
This commit is contained in:
parent
10fc03ab19
commit
f65c0539d8
@ -163,6 +163,12 @@ def main():
|
|||||||
'run as root. You don\'t want this. Don\'t do it.'
|
'run as root. You don\'t want this. Don\'t do it.'
|
||||||
' Even if you think you want it, you don\'t. '
|
' Even if you think you want it, you don\'t. '
|
||||||
'You\'re probably dumb if you do this.')
|
'You\'re probably dumb if you do this.')
|
||||||
|
parser.add_option('', '--allow-home', action='store_true',
|
||||||
|
dest='allowHome',
|
||||||
|
help='Determines whether the wizard will be allowed to '
|
||||||
|
'run directly in the HOME directory. '
|
||||||
|
'You should not do this unless you want it to '
|
||||||
|
'create multiple files in your HOME directory.')
|
||||||
parser.add_option('', '--no-network', action='store_false',
|
parser.add_option('', '--no-network', action='store_false',
|
||||||
dest='network',
|
dest='network',
|
||||||
help='Determines whether the wizard will be allowed to '
|
help='Determines whether the wizard will be allowed to '
|
||||||
@ -171,6 +177,9 @@ def main():
|
|||||||
if os.name == 'posix':
|
if os.name == 'posix':
|
||||||
if (os.getuid() == 0 or os.geteuid() == 0) and not options.allowRoot:
|
if (os.getuid() == 0 or os.geteuid() == 0) and not options.allowRoot:
|
||||||
error('Please, don\'t run this as root.')
|
error('Please, don\'t run this as root.')
|
||||||
|
if os.name == 'posix':
|
||||||
|
if (os.getcwd() == os.path.expanduser('~')) and not options.allowHome:
|
||||||
|
error('Please, don\'t run this in your HOME directory.')
|
||||||
|
|
||||||
filename = ''
|
filename = ''
|
||||||
if args:
|
if args:
|
||||||
|
Loading…
Reference in New Issue
Block a user