Bug 85019

Summary: .ppd file lines with missing
Product: [Retired] Red Hat Public Beta Reporter: Owen Taylor <otaylor>
Component: cupsAssignee: Tim Waugh <twaugh>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: phoebe   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-02-25 17:52:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Offending PPD file
none
cups-1.1.17-space.patch none

Description Owen Taylor 2003-02-24 21:57:59 UTC
I'm going to attach a .ppd file (from one of the printers
we have around here) that cups misparses.

The .ppd spec says (page 23):

 The value is composed of printable 7-bit ASCII byte codes, possibly sepa-
 rated by spaces and tabs into multiple components. It is terminated by a 
 newline, or by a slash, in the case of a translation string.

Which isn't very clear about internal whitespace, but the
fact that HP shipped this file indicates that practically
speaking CUPS needs to strip it.

This causes gnome-print to crash because the ->defchoice 
for the PaperSize option doesn't point to one of the
defined PaperSize values for the print.

I'll work around this in gnome-print (and fix the crash) but
it would be good to get this fixed in the CUPS library as well.

Comment 1 Owen Taylor 2003-02-24 21:58:35 UTC
Created attachment 90322 [details]
Offending PPD file

Comment 2 Owen Taylor 2003-02-24 22:00:37 UTC
Since it may not be clear, the problem with this file is that
the:

*DefaultPageSize: Letter 

Has a trailing space. (I miswrote PageSize instead of PaperSize
above)

Comment 3 Tim Waugh 2003-02-25 17:32:52 UTC
Created attachment 90356 [details]
cups-1.1.17-space.patch

Is this the kind of patch you're after?  I'm not quite sure how to provoke the
gnome-print crash you see.

Comment 4 Owen Taylor 2003-02-25 17:45:19 UTC
No, I don't think that's the right field, the option would be (from
memory)

 PageSize Letter/Letter: <<asdfasdfa>>
          ^^^^^^^^^^^^^

While this is:

 DefaultPageSize: Letter 
                  ^^^^^^^
It's a StringValue in the terminology of the .ppd spec.
It might be best to just to send this bug upstream unless you feel
comfortable with the .ppd parsing code. I've worked around it
in gnome-print now. (So, if you are using the latest gnome-print
from the tree, it won't be possible to reproduce the problem.)