mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-24 19:14:09 +01:00
Be less hostile to users in --allow-root help
This commit is contained in:
parent
d080edce00
commit
9e03e0e6e2
@ -178,14 +178,14 @@ 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 a security risk since it allows anyone to run '
|
||||||
'option. Don\'t do this.')
|
'any command on your bot, so we advise not to use 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. This should not be used except in special '
|
||||||
'Even if you think you want it, you don\'t. '
|
'circumstances, such as running inside a containerized '
|
||||||
'You\'re probably dumb if you do this.')
|
'environment.')
|
||||||
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 '
|
help='Determines whether some extra debugging stuff '
|
||||||
'will be logged in this script.')
|
'will be logged in this script.')
|
||||||
@ -198,7 +198,7 @@ if __name__ == '__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:
|
||||||
sys.stderr.write('Don\'t even try to run this as root.')
|
sys.stderr.write('Running as root is not supported by default (see --allow-root).')
|
||||||
sys.stderr.write(os.linesep)
|
sys.stderr.write(os.linesep)
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
|
@ -175,9 +175,9 @@ def main():
|
|||||||
parser.add_option('', '--allow-root', action='store_true',
|
parser.add_option('', '--allow-root', action='store_true',
|
||||||
dest='allowRoot',
|
dest='allowRoot',
|
||||||
help='Determines whether the wizard will be allowed to '
|
help='Determines whether the wizard will be allowed to '
|
||||||
'run as root. You don\'t want this. Don\'t do it.'
|
'as root. This should not be used except in special '
|
||||||
' Even if you think you want it, you don\'t. '
|
'circumstances, such as running inside a containerized '
|
||||||
'You\'re probably dumb if you do this.')
|
'environment.')
|
||||||
parser.add_option('', '--allow-home', action='store_true',
|
parser.add_option('', '--allow-home', action='store_true',
|
||||||
dest='allowHome',
|
dest='allowHome',
|
||||||
help='Determines whether the wizard will be allowed to '
|
help='Determines whether the wizard will be allowed to '
|
||||||
@ -199,7 +199,7 @@ def main():
|
|||||||
(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:
|
||||||
error('Please, don\'t run this as root.')
|
error('Running as root is not supported by default (see --allow-root).')
|
||||||
if os.name == 'posix':
|
if os.name == 'posix':
|
||||||
if (os.getcwd() == os.path.expanduser('~')) and not options.allowHome:
|
if (os.getcwd() == os.path.expanduser('~')) and not options.allowHome:
|
||||||
error('Please, don\'t run this in your HOME directory.')
|
error('Please, don\'t run this in your HOME directory.')
|
||||||
|
Loading…
Reference in New Issue
Block a user