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

Sharing remote printers is not possible (anymore) #4766

Closed
michaelrsweet opened this issue Feb 3, 2016 · 9 comments
Closed

Sharing remote printers is not possible (anymore) #4766

michaelrsweet opened this issue Feb 3, 2016 · 9 comments

Comments

@michaelrsweet
Copy link
Collaborator

@michaelrsweet michaelrsweet commented Feb 3, 2016

Version: 2.2-current
CUPS.org User: bugless

I'm running Debian-testing mostly. I've been running larger networks of CUPS daemons for years being able to concentrate and route printing jobs using cupsd on several connected hosts by simply resharing remote printers to pass jobs between daemons.

Up until three months ago, this has worked flawlessly on Debian-testing. As of now I notice that remote printers get their shared attribute forced off. Checking the source code the cause is quite obvious. The patch is attached and is trivial. It restores the old functionality.

It kind of makes me wonder why someone decided to turn off this useful functionality at all?

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Feb 3, 2016

CUPS.org User: bugless

Incidentally, it also seems to apply to older versions. For some reason the Debian releases of testing did not copy the bug until very recently.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Feb 3, 2016

CUPS.org User: bugless

For reference, debian-testing cups-daemon 2.1.2-1 installed Dec 3rd 2015 did not exhibit the problem. debian-testing cups-daemon 2.1.2-2+b1 installed Jan 22nd 2016 does exhibit the problem.

I notice that in the CUPS sources that particular bug seems to have been checked in around 2007 already.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Feb 3, 2016

CUPS.org User: jsmeix.suse

It would have helped if you provided details what exactly
you mean with "simply resharing remote printers".

At least on first glance (without details) I think
https://www.cups.org/str.php?L4738
is probably basically the same issue.

See there for background information.

I do not use Debian but currently I cannot imagine
how it could have worked with any newer CUPS version
(e.g. debian-testing "cups-daemon 2.1.2-1").

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Feb 3, 2016

CUPS.org User: mike

All,

This was an intention change to fix known security and functional issues with such configurations. This will not be "fixed" because reverting that change will bring back the bugs it was causing, the most serious of which would cause the creation of thousands of copies of the re-shared printer on every client - still possible thanks to things like cups-browsed...

Johannes: STR #4738 added an error message rather than silently ignoring the request to share - not the same issue, but related in that you weren't being told why the share request was ignored.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Feb 3, 2016

"cupsreshareremote.patch":

commit 1a60102f5e25e4f3eabe740c5ce8631ca6d2da8d
Author: Stephen R. van den Berg srb@cuci.nl
Date:   Wed Feb 3 12:35:52 2016 +0100

Allow remote printers to be reshared again.

diff --git a/scheduler/ipp.c b/scheduler/ipp.c
index fda29e6..09d0538 100644
--- a/scheduler/ipp.c
+++ b/scheduler/ipp.c
@@ -978,16 +978,6 @@ add_class(cupsd_client_t  _con,        /_ I - Client connection */
   if ((attr = ippFindAttribute(con->request, "printer-is-shared",
                                IPP_TAG_BOOLEAN)) != NULL)
   {
-    if (pclass->type & CUPS_PRINTER_REMOTE)
-    {
-     /*
-      \* Cannot re-share remote printers.

-      */
-      send_ipp_status(con, IPP_BAD_REQUEST, _("Cannot change printer-is-shared for remote queues."));
-      return;

-    }

 if (pclass->shared && !attr->values[0].boolean)
   cupsdDeregisterPrinter(pclass, 1);

@@ -2481,16 +2471,6 @@ add_printer(cupsd_client_t  _con,    /_ I - Client connection */
       return;
     }
-    if (printer->type & CUPS_PRINTER_REMOTE)
-    {
-     /*
-      \* Cannot re-share remote printers.

-      */
-      send_ipp_status(con, IPP_BAD_REQUEST, _("Cannot change printer-is-shared for remote queues."));
-      return;

-    }

 if (printer->shared && !attr->values[0].boolean)
   cupsdDeregisterPrinter(printer, 1);

diff --git a/scheduler/printers.c b/scheduler/printers.c
index ed733bc..cd1679f 100644
--- a/scheduler/printers.c
+++ b/scheduler/printers.c
@@ -2464,13 +2464,6 @@ cupsdSetPrinterAttrs(cupsd_printer_t _p)/_ I - Printer to setup */
   }

  /*
-  \* Force sharing off for remote queues...

-  */
-  if (p->type & CUPS_PRINTER_REMOTE)

-    p->shared = 0;
- /*
  - Populate the document-format-supported attribute...
    */
@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Feb 3, 2016

CUPS.org User: bugless

Well, that is all fine and dandy, but how do I setup CUPS to forward printing jobs from one server to the next then?

It appears that it currently is impossible to configure this, so the only option I have to support my deployments is to run a patched version instead.

Can't we add some "I can deal with the pain, so allow me to shoot me in the foot" option somewhere?

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Feb 3, 2016

CUPS.org User: mike

Use something like cups-browsed to automate things for you.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

@michaelrsweet michaelrsweet commented Feb 3, 2016

CUPS.org User: bugless

The cups daemons which I am connecting are located across locations within an organisation and are usually not in the same broadcast domain.
Also, note that I do not need things automated, I'd like to be in control.
Using something like cups-browsed sounds like a nightmare, because then I'd relinquish control over which printers are visible where.

@quiricada

This comment has been minimized.

Copy link

@quiricada quiricada commented Jan 21, 2017

i have a cups server with an epson lx-300 printer.

on another cups server, am using ipp to add the epson printer as a raw queue/printer, however, error message "cannot change printer is shared for remote queues".

am just trying to print to the epson printer, am not sharing it.
2.
if i set it with epson driver, it comes back with filter failures.

am sorry to say that there's some asinine assumptions or whatever for such a common scenario. maybe if "eat your own dog food" is required of every developer, then maybe less of these ivory tower assumptions will be let loose in the wild.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.