RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 988062 - CUPS LPD backend sanitize_title does not operate as documented
Summary: CUPS LPD backend sanitize_title does not operate as documented
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: cups
Version: 6.6
Hardware: All
OS: All
low
low
Target Milestone: rc
: ---
Assignee: Tim Waugh
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-24 15:53 UTC by Jarett Stevens
Modified: 2015-07-23 16:27 UTC (History)
2 users (show)

Fixed In Version: cups-1.4.2-69.el6
Doc Type: Bug Fix
Doc Text:
Documentation for the operation of the CUPS Line Printer Daemon back-end "sanitize_title" option has been amended and now describes the option clearly.
Clone Of:
Environment:
Last Closed: 2015-07-22 06:54:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
CUPS Bugs and Features 4569 0 None None None Never
Red Hat Product Errata RHBA-2015:1346 0 normal SHIPPED_LIVE cups bug fix and enhancement update 2015-07-20 17:59:51 UTC

Description Jarett Stevens 2013-07-24 15:53:29 UTC
Description of problem:

CUPs help indicates the following (from doc/help/network.html): 
sanitize_title=no - Specifies that the job title string should not be restricted to ASCII characters.
sanitize_title=yes - Specifies that the job title string should be restricted to ASCII characters.

The default is sanitize_title=yes.  The above indicates that NON-ASCII characters are restricted (replaced with "_"), but in reality all characters that are not ASCII alphanumeric or space are restricted (for example: ?, $, =).

The relevant section of backend/lpd.c (~line 480):

  if (sanitize_title)
  {
   /*
    * Sanitize the title string so that we don't cause problems on
    * the remote end...
    */

    char *ptr;

    for (ptr = title; *ptr; ptr ++)
      if (!isalnum(*ptr & 255) && !isspace(*ptr & 255))
    *ptr = '_';
  }


Either the code or the documentation should be corrected since the documented operation is misleading.


Possible patch to operate as documented:
--- backend/lpd.c.orig  2013-07-24 10:15:51.102608626 -0500
+++ backend/lpd.c       2013-07-24 10:16:17.495839026 -0500
@@ -493,7 +493,7 @@
     char *ptr;
 
     for (ptr = title; *ptr; ptr ++)
-      if (!isalnum(*ptr & 255) && !isspace(*ptr & 255))
+      if (!isprint(*ptr & 255))
        *ptr = '_';
   }
 


Version-Release number of selected component (if applicable):
specific: cups-1.4.2-50.el6_4.4.x86_64
All versions of cups from 1.4.2-current are affected.

How reproducible:
Always

Steps to Reproduce:
1. Set "Loglevel debug" in /etc/cups/cups.conf
2. Restart CUPS
3. Print test document to any LPD network printer: lpr -Ptestprinter -J TEST=TEST ./test.txt

Actual results:
In debug output (/var/log/cups/error_log): "JTEST_TEST"

Expected results:
In debug output (/var/log/cups/error_log): "JTEST=TEST"

Additional info:
Work around by setting sanitize_title=no in LPD printer URI if the remote end can handle it.

Comment 2 Tim Waugh 2013-07-25 11:03:39 UTC
The code went in several years before the documentation (2003, 2007), so I'm inclined to think it's the documentation that's wrong.

Comment 3 Jarett Stevens 2013-07-25 13:26:43 UTC
That could certainly be the case.  If it's updated to indicate what actually happens, that would be sufficient.  There may be legacy equipment that doesn't handle non-alphanumeric characters in the document title/job name/etc, which could explain why it operates as it does.  In my case I had a legacy platform that required the NAME=VALUE to be passed as part of the LPD communication, and I was lead astray thinking that only non-ASCII characters were stripped. (This was one of several items I was trying to match up when troubleshooting and comparing legacy-to-legacy vs RHEL6-to-legacy LPD communications.)

Comment 4 RHEL Program Management 2013-10-13 23:20:42 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 7 errata-xmlrpc 2015-07-22 06:54:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1346.html


Note You need to log in before you can comment on or make changes to this bug.