Start work on remote control passwords

This commit is contained in:
Kovid Goyal
2022-08-09 11:30:49 +05:30
parent 31be4f041e
commit e64b1ba67c
6 changed files with 65 additions and 18 deletions

View File

@@ -675,6 +675,16 @@ def config_or_absolute_path(x: str, env: Optional[Dict[str, str]] = None) -> Opt
return resolve_abs_or_config_path(x, env)
def remote_control_password(val: str, current_val: Dict[str, str]) -> Iterable[Tuple[str, Tuple[str, ...]]]:
val = val.strip()
if val:
parts = to_cmdline(val, expand=False)
if len(parts) == 1:
yield parts[0], ()
else:
yield parts[0], tuple(parts[1:])
def allow_remote_control(x: str) -> str:
if x != 'socket-only':
x = 'y' if to_bool(x) else 'n'