From a91c48533c5edad705d920a486426cd15b4572bf Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sat, 25 Feb 2023 15:28:30 -0500 Subject: [PATCH] When shearing, send "None" for shm instead of "0" Former-commit-id: 6882b4cf064dac1465bfe06bd5c837c149e0f5cd [formerly e30ce078d5d2c1811e7dde8e4c1eb8ed56e8c914] Former-commit-id: bca35d2da074b16b8cdf39b0d3d609b95b9ef059 --- lib/sshyp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index 56d76b8..3baf0eb 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -154,7 +154,7 @@ def decrypt(_entry_dir, _shm_folder, _shm_entry, _quick_pass, _unlock_method = ['gpg', '--pinentry-mode', 'loopback', '--passphrase', _quick_pass, '-qd', '--output'] else: _unlock_method = ['gpg', '-qd', '--output'] - if _shm_folder == 0 and _shm_entry == 0: # TODO set to 'None' + if _shm_folder is None and _shm_entry is None: _output_target = ['/dev/null', expanduser('~/.config/sshyp/lock.gpg')] else: _output_target = [f"{_tmp_dir}{_shm_folder}/{_shm_entry}", f"{_entry_dir}.gpg"] @@ -773,7 +773,7 @@ def remove_data(): # deletes an entry from the server and flags it for local de _entry_name = entry_name_fetch('entry/folder to shear: ') else: _entry_name = entry_name_fetch() - determine_decrypt(expanduser('~/.config/sshyp/lock.gpg'), 0, 0) + determine_decrypt(expanduser('~/.config/sshyp/lock.gpg'), None, None) if not ssh_error: run(['ssh', '-i', expanduser('~/.ssh/sshyp'), '-p', port, f"{username_ssh}@{ip}", f'cd /lib/sshyp; python3 -c \'from sshync import delete; delete("{_entry_name}", "remotely")\''])