From: msweet Date: Tue, 17 Nov 2015 19:25:54 +0000 (+0000) Subject: Changing the printer-is-shared value for a remote queue did not produce an X-Git-Tag: v2.2b1~147 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7dc6f91d5eebb60c74af39531b91fa83f456355b;p=thirdparty%2Fcups.git Changing the printer-is-shared value for a remote queue did not produce an error (STR #4738) git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12977 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-2.1.txt b/CHANGES-2.1.txt index 91f95e3928..ad807f2138 100644 --- a/CHANGES-2.1.txt +++ b/CHANGES-2.1.txt @@ -28,6 +28,8 @@ CHANGES IN CUPS V2.1.1 - Added USB quirk for Canon MP530 (STR #4730) - The scheduler did not deliver job notifications for jobs submitted to classes (STR #4733) + - Changing the printer-is-shared value for a remote queue did not + produce an error (STR #4738) - Updated localizations (STR #4709) diff --git a/scheduler/ipp.c b/scheduler/ipp.c index c0834c0a20..7a2fecd743 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -978,6 +978,16 @@ 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); @@ -2471,6 +2481,16 @@ 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);