mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-27 06:33:21 -05:00
[httpd] Better logging of unauthorized requests
This commit is contained in:
parent
f5721b7a18
commit
3ba92aa860
@ -723,7 +723,7 @@ daap_request_authorize(struct httpd_request *hreq)
|
||||
{
|
||||
if (!session)
|
||||
{
|
||||
DPRINTF(E_LOG, L_DAAP, "DAAP session not found: '%s'\n", hreq->uri_parsed->uri);
|
||||
DPRINTF(E_LOG, L_DAAP, "Unauthorized request from '%s', DAAP session not found: '%s'\n", hreq->peer_address, hreq->uri_parsed->uri);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -749,7 +749,7 @@ daap_request_authorize(struct httpd_request *hreq)
|
||||
ret = httpd_basic_auth(hreq->req, NULL, passwd, cfg_getstr(cfg_getsec(cfg, "library"), "name"));
|
||||
if (ret != 0)
|
||||
{
|
||||
DPRINTF(E_LOG, L_DAAP, "Unsuccessful library authentication\n");
|
||||
DPRINTF(E_LOG, L_DAAP, "Unsuccessful library authorization attempt from '%s'\n", hreq->peer_address);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -595,6 +595,8 @@ dacp_request_authorize(struct httpd_request *hreq)
|
||||
return 0;
|
||||
|
||||
invalid:
|
||||
DPRINTF(E_LOG, L_DACP, "Unauthorized request '%s' from '%s' (is peer trusted in your config?)\n", hreq->uri_parsed->uri, hreq->peer_address);
|
||||
|
||||
httpd_send_error(hreq->req, 403, "Forbidden");
|
||||
return -1;
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ rsp_request_authorize(struct httpd_request *hreq)
|
||||
ret = httpd_basic_auth(hreq->req, NULL, passwd, cfg_getstr(cfg_getsec(cfg, "library"), "name"));
|
||||
if (ret != 0)
|
||||
{
|
||||
DPRINTF(E_LOG, L_RSP, "Unsuccessful library authentication\n");
|
||||
DPRINTF(E_LOG, L_RSP, "Unsuccessful library authorization attempt from '%s'\n", hreq->peer_address);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user