From 359edcd46c1a510e43a978914952ea357df1bf53 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Wed, 12 Oct 2022 12:32:54 -0400 Subject: [PATCH] Ensure generated device id is a valid file name Former-commit-id: 950080785d4666364b5452a4e0b48ce999852ef8 [formerly 3147d9327b634ef8e08390524f9956bf01d1d605] Former-commit-id: da5d01ac15b077cb2d63668ee9be491ef597a105 --- lib/sshyp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index 733e13f..20f95a3 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -300,8 +300,8 @@ def tweak(): # runs configuration wizard remove(f"{path.expanduser('~/.config/sshyp/devices/')}{_id}") print(f"{_divider}\u001b[4;1mimportant:\u001b[0m this id \u001b[4;1mmust\u001b[0m be unique amongst your " f"client devices\n\nthis is used to keep track of database syncing and quick-unlock permissions\n") - _device_id_prefix = str(input('device id: ')) - _device_id_suffix = string_gen('c', randint(12, 48)) + _device_id_prefix = str(input('device id: ')) + '-' + _device_id_suffix = string_gen('s', randint(24, 48)) _device_id = _device_id_prefix + _device_id_suffix open(f"{path.expanduser('~/.config/sshyp/devices/')}{_device_id}", 'w')