Skip to content

Commit 89f7f5d

Browse files
authored
backend/ipp.c: Fix infinite loop with Kerberos
If IP address was used with Kerberos, IPP backend retried connection indefinitely. The fix is to abort when we find out hostname is an IP address and we require Kerberos. Fixes #838
2 parents 3d185dd + a4dad27 commit 89f7f5d

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Changes in CUPS v2.5b1 (TBA)
4040
- Fixed memory leak when creating color profiles (Issue #814)
4141
- Fixed crash in `scan_ps()` if incoming argument is NULL (Issue #831)
4242
- Fixed setting job state reasons for successful jobs (Issue #832)
43+
- Fixed infinite loop in IPP backend if hostname is IP address with Kerberos (Issue #838)
4344
- Fixed crash in `ppdEmitString()` if there is no record for page size `Custom`
4445
(Issue #849)
4546
- Fixed reporting `media-source-supported` when sharing printer which has numbers as strings

backend/ipp.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,19 @@ main(int argc, /* I - Number of command-line args */
409409
else
410410
cupsSetEncryption(HTTP_ENCRYPTION_IF_REQUESTED);
411411

412+
if (!strcmp(auth_info_required, "negotiate") &&
413+
(isdigit(hostname[0] & 255) || hostname[0] == '['))
414+
{
415+
/*
416+
* IP addresses are not allowed with Kerberos...
417+
*/
418+
419+
_cupsLangPrintFilter(stderr, "ERROR",
420+
_("IP address is not allowed as hostname when using Negotiate - use FQDN."));
421+
update_reasons(NULL, "-connecting-to-device");
422+
return (CUPS_BACKEND_FAILED);
423+
}
424+
412425
/*
413426
* See if there are any options...
414427
*/

0 commit comments

Comments
 (0)