Fix --allow-remote-control without passwords not working

This commit is contained in:
Kovid Goyal 2022-08-16 10:51:54 +05:30
parent 18bf76d49e
commit 02d06d6726
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -523,8 +523,10 @@ class Window:
self.allow_remote_control = allow_remote_control self.allow_remote_control = allow_remote_control
def remote_control_allowed(self, pcmd: Dict[str, Any], extra_data: Dict[str, Any]) -> bool: def remote_control_allowed(self, pcmd: Dict[str, Any], extra_data: Dict[str, Any]) -> bool:
if not self.allow_remote_control or not self.remote_control_passwords: if not self.allow_remote_control:
return False return False
if not self.remote_control_passwords:
return True
pw = pcmd.get('password', '') pw = pcmd.get('password', '')
auth_items = self.remote_control_passwords.get(pw) auth_items = self.remote_control_passwords.get(pw)
if pw == '!': if pw == '!':