Strip newlines when parsing tor password (#801)

When parsing control.conf or password file, a newline character could cause
Authentication Errors.
This commit is contained in:
MadcowOG 2022-07-06 15:52:02 +00:00 committed by GitHub
parent f688b88bd8
commit 03eeb3fad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,7 @@ def send_tor_signal(signal: Signal) -> bool:
# Scan for the last line of the file.
for line in conf:
pass
secret = line
secret = line.strip('\n')
authenticate_password(c, password=secret)
else:
cookie_path = '/var/lib/tor/control_auth_cookie'