From a27981926028fd58ddedc0ff534550417cc62f0b Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 4 Dec 2022 18:57:23 -0500 Subject: [PATCH] Replaced use of system-provided 'ls' with 'os.listdir' Former-commit-id: cbd6302ec15624381303d1181861d3c2792475a6 [formerly 31a4c7b8e7af93b3139ac65e6e0731be98def3f9] Former-commit-id: acd4d9db5d557793aca4662e48ca88320b7a3bfa --- lib/sshyp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index 5a3b701..a858c73 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -554,7 +554,8 @@ def whitelist_verify(_port, _username_ssh, _ip, _client_device_id): except CalledProcessError: _i, _full_password = 0, '' _server_whitelist = run(['ssh', '-i', expanduser('~/.ssh/sshyp'), '-p', _port, f"{_username_ssh}@{_ip}", - 'ls ~/.config/sshyp/whitelist'], stdout=PIPE, text=True).stdout.rstrip().split('\n') + f'python -c \'from os import listdir; print(*listdir("/home/{_username_ssh}' + f'/.config/sshyp/whitelist"))\''], stdout=PIPE, text=True).stdout.rstrip().split(' ') for _device_id in _server_whitelist: if _device_id == _client_device_id: _quick_unlock_password = input('\nquick-unlock passphrase: ')