option to always require admin to auth

This commit is contained in:
ed 2023-10-10 00:33:02 +00:00
parent 6dd4f7648a
commit 61e7b65bc1
2 changed files with 2 additions and 1 deletions

View File

@ -46,6 +46,7 @@ def optgen(ap, pwd):
ac.add_argument("-tpt", metavar="PORT", type=int, default=0, help="TLS telnet port, e.g. 2424 (disable with 0)")
ac.add_argument("-tpn", metavar="PORT", type=int, default=0, help="TLS netcat port, e.g. 1515 (disable with 0)")
ac.add_argument("-pw", metavar="PWD", type=u, default=pwd, help="admin password")
ac.add_argument("--ara", action="store_true", help="admin-access requires auth (even for localhost)")
ac.add_argument("--nsalt", metavar="TXT", type=u, default="lammo/", help="salt for generated nicknames based on IP")
ac = ap.add_argument_group("logging")

View File

@ -481,7 +481,7 @@ class VT100_Client(object):
with self.world.mutex:
self.default_config()
self.user.client = self
self.user.admin = self.adr[0] == "127.0.0.1" # TODO
self.user.admin = self.adr[0] == "127.0.0.1" and not self.ar.ara
try:
(