DNS-SD-based print queues pointing to CUPS server are not considered remote printers with driver on server #4158

Closed
michaelrsweet opened this Issue Aug 4, 2012 · 8 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Aug 4, 2012

Version: 1.6-current
CUPS.org User: till.kamppeter

In times of CUPS broadcasting the automatically created queues on the clients had "ipp://..." URIs and they were correctly considered printers on a remote CUPS server with driver on the server. Also manually created raw queues with appropriate "ipp://..." URIs pointing to a CUPS server were considered as such. Now without broadcasting and with printers often getting changing IPs from DHCP servers one would use "dnssd://..." URIs for such queues, but with these URIs the queues are not considered as pointing to a remote CUPS server.

The attached patch corrects this.

Collaborator

michaelrsweet commented Aug 8, 2012

CUPS.org User: mike

P2 since static remote queues (particularly using Bonjour) are deprecated in favor of the new dynamic printer enumeration APIs.

Collaborator

michaelrsweet commented Aug 28, 2012

CUPS.org User: mike

I'm not sure I understand the point of the patch - it seems to only treat dnssd: URIs as potential CUPS queues, but in fact we also want to allow ipp: and ipps: URIs that have a DNS-SD service name in them to be treated as CUPS queues, too.

Collaborator

michaelrsweet commented Aug 28, 2012

CUPS.org User: till.kamppeter

The patch is fixing bugs in the use of &&, ||, and parantheses. The original expression is only true on addresses starting with "ipp://", my fixed version gives true for either URIs starting with "ipp://" and containing "/printers/" or "/classes/" or for URIs starting with "dnssd:/" containing "_ipp" or "_ipps" and ending with "/cups". This should cover all CUPS "ipp:" and "dnssd:" URIs which represent remote CUPS queues.

I see now that the patch is missing support for "ipps://" URIs.

Collaborator

michaelrsweet commented Aug 29, 2012

CUPS.org User: mike

Fixed in Subversion repository.

Collaborator

michaelrsweet commented Aug 29, 2012

CUPS.org User: till.kamppeter

Where do I find documentation about using the new dynamic printer enumeration APIs? Does this require changes in the client applications or can I still share printers simply via tyhe configuration of the server's and the client's CUPS daemons?

Collaborator

michaelrsweet commented Aug 29, 2012

CUPS.org User: mike

You can find documentation on cupsEnumDests here:

http://www.cups.org/documentation.php/api-cups.html

or in the local web interface copy.

You share printers on the server, you don't change a damned thing on the client.

Collaborator

michaelrsweet commented Aug 29, 2012

"recognize-remote-cups-queue-via-dnssd-uri.patch":

diff -uraN cups/scheduler/printers.c cups-new/scheduler/printers.c
--- cups/scheduler/printers.c 2012-05-25 15:28:49.000000000 +0200
+++ cups-new/scheduler/printers.c 2012-08-04 20:58:40.475725544 +0200
@@ -4829,13 +4829,14 @@
"printer-make-and-model", NULL,
"Local System V Printer");
}

  • else if (!strncmp(p->device_uri, "ipp://", 6) &&
  •    (strstr(p->device_uri, "/printers/") != NULL ||
    
  •     strstr(p->device_uri, "/classes/") != NULL ||
    
  •     ((strstr(p->device_uri, "._ipp.") != NULL ||
    
  •       strstr(p->device_uri, "._ipps.") != NULL) &&
    
  •      !strcmp(p->device_uri + strlen(p->device_uri) - 5,
    
  •          "/cups"))))
    
  • else if ((!strncmp(p->device_uri, "ipp://", 6) &&
  •     (strstr(p->device_uri, "/printers/") != NULL ||
    
  •      strstr(p->device_uri, "/classes/") != NULL)) ||
    
  •    (!strncmp(p->device_uri, "dnssd://", 8) &&
    
  •     (strstr(p->device_uri, "._ipp.") != NULL ||
    
  •      strstr(p->device_uri, "._ipps.") != NULL) &&
    
  •     !strcmp(p->device_uri + strlen(p->device_uri) - 5,
    
  •         "/cups")))
    
    {
    /*
    • Tell the client this is really a hard-wired remote printer.
Collaborator

michaelrsweet commented Aug 29, 2012

"str4158.patch":

Index: scheduler/printers.c

--- scheduler/printers.c (revision 10572)
+++ scheduler/printers.c (working copy)
@@ -4829,13 +4829,13 @@
"printer-make-and-model", NULL,
"Local System V Printer");
}

  • else if (!strncmp(p->device_uri, "ipp://", 6) &&
  •    (strstr(p->device_uri, "/printers/") != NULL ||
    
  •     strstr(p->device_uri, "/classes/") != NULL ||
    
  •     ((strstr(p->device_uri, "._ipp.") != NULL ||
    
  •       strstr(p->device_uri, "._ipps.") != NULL) &&
    
  •      !strcmp(p->device_uri + strlen(p->device_uri) - 5,
    
  •          "/cups"))))
    
  • else if (((!strncmp(p->device_uri, "ipp://", 6) ||
  •           !strncmp(p->device_uri, "ipps://", 7)) &&
    
  •     (strstr(p->device_uri, "/printers/") != NULL ||
    
  •      strstr(p->device_uri, "/classes/") != NULL)) ||
    
  •    ((strstr(p->device_uri, "._ipp.") != NULL ||
    
  •      strstr(p->device_uri, "._ipps.") != NULL) &&
    
  •     !strcmp(p->device_uri + strlen(p->device_uri) - 5, "/cups")))
    
    {
    /*
    • Tell the client this is really a hard-wired remote printer.

@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016

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