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 738410 - [RHEL 6] textonly filter won't work as a pipe with copies=1
Summary: [RHEL 6] textonly filter won't work as a pipe with copies=1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: cups
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Tim Waugh
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-14 18:04 UTC by Bryan Mason
Modified: 2012-06-20 13:13 UTC (History)
6 users (show)

Fixed In Version: cups-1.4.2-45.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 660518
Environment:
Last Closed: 2012-06-20 13:13:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0818 0 normal SHIPPED_LIVE cups bug fix update 2012-06-19 20:34:20 UTC

Description Bryan Mason 2011-09-14 18:04:03 UTC
+++ This bug was initially created as a clone of Bug #660518 +++

Description of problem:

    If the textonly filter is used as a pipe (i.e. no filename is specified
    on the command line, and the number of copies is "1", then it fails.

Version-Release number of selected component (if applicable):

    cups-1.3.7-11.el5_4.3

How reproducible:

    100%  

Steps to Reproduce:

    $ export PPD=/usr/share/cups/model/textonly.ppd
    $ cat /etc/fstab | /usr/lib/cups/filter/textonly 1 me hi 1 "" 

    (the "export PPD..." command isn't strictly necessary, but it
    eliminates an unrelated error message from grep)
  
Actual results:

    /usr/lib/cups/filter/textonly: line 109: : No such file or directory

Expected results:

    The contents of /etc/fstab.

Additional info:

    This is a real-world problem.  To enable printing of C-language
    source files on a text-only printer, I needed to add the line:

        application/x-csource text/plain    10  textonly

    to /etc/cups/local.convs, but then the textonly filter failed as
    described above.

    Line 31 in /usr/lib/cups/filter/textonly:

        if [ "$COPIES" -gt 1 ] && [ $# -lt 6 ]; then

    doesn't make sense to me.  The purpose of that code block (lines
    31-38) is to copy the input file to a temporary file so that the
    next code block (lines 40-50) can perform some LF->CRLF
    translation on the file.  BUT ... the temporary file doesn't get
    created if the number of copies is 1.  As a result,
    the sed command fails and no data is sent to the printer.

    It would seem to me that line 31 should read:

        if [ $# -lt 6 ]; then

    which would create the temp file regardless of the number of copies.

    Making the change above resolved the issue in my testing.

    This is also a problem in Fedora and RHEL 6.

--- Additional comment from jpopelka on 2011-09-14 13:10:34 EDT ---

(In reply to comment #0)
> Actual results:
>     /usr/lib/cups/filter/textonly: line 109: : No such file or directory
> ...
>     This is also a problem in Fedora and RHEL 6.

I can confirm that I see this warning with cups-1.5.0 (F-16) and cups-1.4.2 (RHEL-6) but in RHEL-5 I see:

sed: can't read : No such file or directory

Maybe you posted the warning from RHEL-6 ?
However your suggested solution fixes the problem.

Have you ever reported this upstream ? Are you going to do that ? Do you want me to do that ?

--- Additional comment from bmason on 2011-09-14 13:58:06 EDT ---

Hmmm . . . yes, it appears I might have copied the wrong error message. In RHEL 5, I get:

    sed: can't read : No such file or directory

and in RHEL 6 I get:

    /usr/lib/cups/filter/textonly: line 109: : No such file or directory

I haven't yet reported this upstream (or cloned this for RHEL 6 and Fedora), but will do so now.

--- Additional comment from bmason on 2011-09-14 14:01:10 EDT ---

Actually, it looks like the textonly filter doesn't exist upstream.  It was added by Red Hat.

Comment 8 errata-xmlrpc 2012-06-20 13:13:26 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.

http://rhn.redhat.com/errata/RHBA-2012-0818.html


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