mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-22 18:14:41 +01:00
allowRoot fix and some spacing fixes
This commit is contained in:
parent
e97c610e77
commit
b8ad661e27
@ -158,16 +158,16 @@ if __name__ == '__main__':
|
|||||||
help='Determines whether the bot will allow its '
|
help='Determines whether the bot will allow its '
|
||||||
'defaultCapabilities not to include "-owner", thus '
|
'defaultCapabilities not to include "-owner", thus '
|
||||||
'giving all users the owner capability by default. '
|
'giving all users the owner capability by default. '
|
||||||
'This is dumb, hence we require a command-line '
|
' This is dumb, hence we require a command-line '
|
||||||
'option. Don\'t do this.')
|
'option. Don\'t do this.')
|
||||||
parser.add_option('', '--allow-root', action='store_true',
|
parser.add_option('', '--allow-root', action='store_true',
|
||||||
dest='allowRoot',
|
dest='allowRoot',
|
||||||
help='Determines whether the bot will be allowed to run'
|
help='Determines whether the bot will be allowed to run '
|
||||||
'as root. You don\'t want this. Don\'t do it. '
|
'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('', '--debug', action='store_true', dest='debug',
|
parser.add_option('', '--debug', action='store_true', dest='debug',
|
||||||
help='Determines whether some extra debugging stuff will'
|
help='Determines whether some extra debugging stuff will '
|
||||||
'be logged in this script.')
|
'be logged in this script.')
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
@ -222,7 +222,7 @@ if __name__ == '__main__':
|
|||||||
nick = options.nick or conf.supybot.nick()
|
nick = options.nick or conf.supybot.nick()
|
||||||
user = options.user or conf.supybot.user()
|
user = options.user or conf.supybot.user()
|
||||||
ident = options.ident or conf.supybot.ident()
|
ident = options.ident or conf.supybot.ident()
|
||||||
|
|
||||||
networks = conf.supybot.networks()
|
networks = conf.supybot.networks()
|
||||||
if not networks:
|
if not networks:
|
||||||
questions.output("""No networks defined. Perhaps you should re-run the
|
questions.output("""No networks defined. Perhaps you should re-run the
|
||||||
@ -230,7 +230,7 @@ if __name__ == '__main__':
|
|||||||
# XXX We should turn off logging here for a prettier presentation.
|
# XXX We should turn off logging here for a prettier presentation.
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if options.optimize:
|
if options.optimize:
|
||||||
# This doesn't work anymore.
|
# This doesn't work anymore.
|
||||||
|
@ -143,13 +143,13 @@ def main():
|
|||||||
version='Supybot %s' % conf.version)
|
version='Supybot %s' % conf.version)
|
||||||
parser.add_option('', '--allow-root', action='store_true',
|
parser.add_option('', '--allow-root', action='store_true',
|
||||||
dest='allowRoot',
|
dest='allowRoot',
|
||||||
help='Determines whether the bot will be allowed to run'
|
help='Determines whether the wizard will be allowed to '
|
||||||
'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.')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
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:
|
||||||
sys.stderr.write('Please, don\'t run this as root.\n')
|
sys.stderr.write('Please, don\'t run this as root.\n')
|
||||||
|
|
||||||
filename = ''
|
filename = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user