Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matching of hostnames does not deal with trailing period #4563

Closed
michaelrsweet opened this issue Jan 14, 2015 · 2 comments
Closed

Matching of hostnames does not deal with trailing period #4563

michaelrsweet opened this issue Jan 14, 2015 · 2 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 2.0-current
CUPS.org User: mike

[Reported by Eren Rodrigez on the IPP WG mailing list]

Hello,

I have been playing with the IPP Everywhere Printer Self-Certification test suite and I would like to challenge another failure seen with our IPP printers at HP.
I apologize if these experience reports seem staggered, but I needed to investigate this issue further before reporting them as possible test error.

More specifically, inside ipp-tests.test, there are test cases around printer-resident URIs and their hostname expectations.

I-9. Get-Printer-Attributes Operation (default) [FAIL]
RECEIVED: 12508 bytes in response
status-code = successful-ok (successful-ok)
EXPECTED: printer-icons WITH-ALL-VALUES "HP6451060F1496.local."
GOT: printer-icons="http://HP6451060F1496.local/webApps/images/printer-small.png"
GOT: printer-icons="http://HP6451060F1496.local/webApps/images/printer.png"
GOT: printer-icons="http://HP6451060F1496.local/webApps/images/printer-large.png"
EXPECTED: printer-supply-info-uri WITH-VALUE "HP6451060F1496.local."
GOT: printer-supply-info-uri=http://HP6451060F1496.local/#hId-pgInkConsumables

According to the IPP Everywhere specification, Section 8.4, �Printers SHOULD use the HTTP Host: header value when generating URIs for use in Client responses.�
Internally, we have captured a WireShark trace while running the tests and noticed that none of the incoming HTTP/IPP packets included the �.� at the end. This is why our responses never included it either. See attached screenshot for more details.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"str4563.patch":

Index: test/ippfind.c

--- test/ippfind.c (revision 12463)
+++ test/ippfind.c (working copy)
@@ -5,7 +5,7 @@

  • commands such as IPP and Bonjour conformance tests. This tool is
  • inspired by the UNIX "find" command, thus its name.
    *
    • * Copyright 2008-2014 by Apple Inc.
    • * Copyright 2008-2015 by Apple Inc.
      *
  • These coded instructions, statements, and computer programs are the
  • property of Apple Inc. and are protected by Federal copyright
    @@ -2564,6 +2564,10 @@
    service->host = strdup(hostTarget);
    service->port = ntohs(port);
  • value = service->host + strlen(service->host) - 1;
  • if (value >= service->host && *value == '.')
  • _value = '\0';

/_

  • Loop through the TXT key/value pairs and add them to an array...
    */
    @@ -2635,6 +2639,10 @@
    service->host = strdup(hostTarget);
    service->port = port;
  • value = service->host + strlen(service->host) - 1;
  • if (value >= service->host && *value == '.')
  • _value = '\0';

/_

  • Loop through the TXT key/value pairs and add them to an array...
    */
    Index: test/ipptool.c

    --- test/ipptool.c (revision 12463)
    +++ test/ipptool.c (working copy)
    @@ -3,7 +3,7 @@
    *
  • ipptool command for CUPS.
    *
  • * Copyright 2007-2014 by Apple Inc.
    • Copyright 2007-2015 by Apple Inc.
    • Copyright 1997-2007 by Easy Software Products.
      *
    • These coded instructions, statements, and computer programs are the
      @@ -3883,6 +3883,10 @@
      if (httpSeparateURI(HTTP_URI_CODING_ALL, ptr, scheme, sizeof(scheme), userpass, sizeof(userpass), buffer, (int)bufsize, &port, resource, sizeof(resource)) < HTTP_URI_STATUS_OK)
      buffer[0] = '\0';
  • ptr = buffer + strlen(buffer) - 1;
  • if (ptr >= buffer && *ptr == '.')
  •  _ptr = '\0';         /_ Drop trailing "." */
    
    return (buffer);
    }
    else if (flags & _CUPS_WITH_RESOURCE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant