Skip to content

Commit

Permalink
Merge pull request from GHSA-qjgh-5hcq-5f25
Browse files Browse the repository at this point in the history
Log result of httpGetHostname BEFORE closing the connection
  • Loading branch information
zdohnal committed Jun 22, 2023
2 parents 3d95ea5 + ffd290b commit 9809947
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions scheduler/client.c
Expand Up @@ -193,13 +193,11 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
/*
* Can't have an unresolved IP address with double-lookups enabled...
*/

httpClose(con->http);

cupsdLogClient(con, CUPSD_LOG_WARN,
"Name lookup failed - connection from %s closed!",
"Name lookup failed - closing connection from %s!",
httpGetHostname(con->http, NULL, 0));

httpClose(con->http);
free(con);
return;
}
Expand Down Expand Up @@ -235,11 +233,11 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */
* with double-lookups enabled...
*/

httpClose(con->http);

cupsdLogClient(con, CUPSD_LOG_WARN,
"IP lookup failed - connection from %s closed!",
"IP lookup failed - closing connection from %s!",
httpGetHostname(con->http, NULL, 0));

httpClose(con->http);
free(con);
return;
}
Expand All @@ -256,11 +254,11 @@ cupsdAcceptClient(cupsd_listener_t *lis)/* I - Listener socket */

if (!hosts_access(&wrap_req))
{
httpClose(con->http);

cupsdLogClient(con, CUPSD_LOG_WARN,
"Connection from %s refused by /etc/hosts.allow and "
"/etc/hosts.deny rules.", httpGetHostname(con->http, NULL, 0));

httpClose(con->http);
free(con);
return;
}
Expand Down

0 comments on commit 9809947

Please sign in to comment.