From: Michael R Sweet Date: Sat, 29 Jun 2024 12:44:12 +0000 (-0400) Subject: Fix how ippeveprinter responds to an unsupported request character set. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4baa1024ac7baf381559755a3d52a72f6b9252eb;p=thirdparty%2Fcups.git Fix how ippeveprinter responds to an unsupported request character set. --- diff --git a/CHANGES.md b/CHANGES.md index 6a2f18139b..201ba6d84e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -99,6 +99,7 @@ Changes in CUPS v2.5b1 (TBA) - Fixed TLS negotiation using OpenSSL with servers that require the TLS SNI extension. - Fixed error handling when reading a mixed `1setOf` attribute. +- Fixed how `ippeveprinter` responds to an unsupported request character set. - Removed hash support for SHA2-512-224 and SHA2-512-256. - Removed `mantohtml` script for generating html pages (use `https://www.msweet.org/mantohtml/`) diff --git a/tools/ippeveprinter.c b/tools/ippeveprinter.c index 0c2b2ce7e4..f6777d9ae5 100644 --- a/tools/ippeveprinter.c +++ b/tools/ippeveprinter.c @@ -5212,7 +5212,9 @@ process_ipp(ippeve_client_t *client) // I - Client if (charset && strcasecmp(ippGetString(charset, 0, NULL), "us-ascii") && strcasecmp(ippGetString(charset, 0, NULL), "utf-8")) { // Bad character set... - respond_ipp(client, IPP_STATUS_ERROR_BAD_REQUEST, "Unsupported character set \"%s\".", ippGetString(charset, 0, NULL)); + respond_ipp(client, IPP_STATUS_ERROR_CHARSET, "Unsupported character set '%s'.", ippGetString(charset, 0, NULL)); + attr = ippCopyAttribute(client->response, charset, 0); + ippSetGroupTag(client->response, &attr, IPP_TAG_UNSUPPORTED_GROUP); } else if (!charset || !language || !uri) {