[Core][RPC] Log authentication error on user/password

Log authentication error due to wrong username or password sent by client.

Closes: https://github.com/deluge-torrent/deluge/pull/475
This commit is contained in:
Dei-Cas Jeremie 2025-02-28 21:25:35 +01:00 committed by Calum Lind
commit 22e9adbc31
No known key found for this signature in database
GPG key ID: 90597A687B836BA3

View file

@ -28,6 +28,7 @@ from deluge.core.authmanager import (
)
from deluge.crypto_utils import check_ssl_keys, get_context_factory
from deluge.error import (
BadLoginError,
DelugeError,
IncompatibleClient,
NotAuthorizedError,
@ -281,6 +282,14 @@ class DelugeRPCProtocol(DelugeTransferProtocol):
send_error()
if not isinstance(ex, _ClientSideRecreateError):
log.exception(ex)
if isinstance(ex, BadLoginError):
peer = self.transport.getPeer()
log.error(
'Deluge client authentication error made from: %s:%s (%s)',
peer.host,
peer.port,
str(ex),
)
else:
self.sendData((RPC_RESPONSE, request_id, (ret)))
if not ret: