From 4005cfdff25bee1356c14a7616d8f239481b2c32 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 17 Aug 2022 00:58:11 +0530 Subject: [PATCH] Disallow passwords that start with - to allow for future addition of options --- kitty/options/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kitty/options/utils.py b/kitty/options/utils.py index e0ffbab9b..9ab74d042 100644 --- a/kitty/options/utils.py +++ b/kitty/options/utils.py @@ -679,6 +679,10 @@ def remote_control_password(val: str, current_val: Dict[str, str]) -> Iterable[T val = val.strip() if val: parts = to_cmdline(val, expand=False) + if parts[0].startswith('-'): + # this is done so in the future we can add --options to the cmd + # line of remote_control_password + raise ValueError('Passwords are not allowed to start with hyphens, ignoring this password') if len(parts) == 1: yield parts[0], tuple() else: