X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=mudpy%2Fcommand.py;h=279da788d9c63389b55af720f9bf3dca1ea78fa5;hp=ea779399ce0a4943c194ebe065eec8cdeae237a2;hb=0de1cbedcdff936f461aa6b9421cb925295bba10;hpb=bc3ee2dd11df80f98cd391a094a17c20df322e7c diff --git a/mudpy/command.py b/mudpy/command.py index ea77939..279da78 100644 --- a/mudpy/command.py +++ b/mudpy/command.py @@ -1,6 +1,6 @@ """User command functions for the mudpy engine.""" -# Copyright (c) 2004-2019 mudpy authors. Permission to use, copy, +# Copyright (c) 2004-2020 mudpy authors. Permission to use, copy, # modify, and distribute this software is granted under terms # provided in the LICENSE file distributed with this software. @@ -115,7 +115,7 @@ def error(actor, input_data): """Generic error for an unrecognized command word.""" # 90% of the time use a generic error - # Whitelist the random.randrange() call in bandit since it's not used for + # Allow the random.randrange() call in bandit since it's not used for # security/cryptographic purposes if random.randrange(10): # nosec message = '''I'm not sure what "''' + input_data + '''" means...''' @@ -171,7 +171,7 @@ def help(actor, parameters): description = command.get("description") if not description: description = "(no short description provided)" - if command.get("administrative"): + if command.is_restricted(): output = "$(red)" else: output = "$(grn)" @@ -194,7 +194,7 @@ def help(actor, parameters): if actor.can_run(command): if really_see_also: really_see_also += ", " - if command.get("administrative"): + if command.is_restricted(): really_see_also += "$(red)" else: really_see_also += "$(grn)" @@ -244,7 +244,7 @@ def help(actor, parameters): "description", "(no short description provided)") # administrative command names are in red, others in green - if command.get("administrative"): + if command.is_restricted(): color = "red" else: color = "grn" @@ -555,7 +555,7 @@ def show(actor, parameters): try: # there is no other option than to use eval() for this, since # its purpose is to evaluate arbitrary expressions, so do what - # we can to secure it and whitelist it for bandit analysis + # we can to secure it and allow it for bandit analysis message = repr(eval( # nosec " ".join(arguments[1:]), {"mudpy": mudpy, "universe": actor.universe}))