options set with "lpadmin -o xxx-default" are not returned by Get-Printer-Attributes

Bug #1199901 reported by Till Kamppeter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cups (Ubuntu)
Fix Released
High
Unassigned
Raring
Fix Released
High
Unassigned
Saucy
Fix Released
High
Unassigned

Bug Description

I have a problem with non-PPD options set in /etc/cups/printers.conf.

For filters and cups-browsed I have defined some options for being
stored in /etc/cups/printers.conf which are not options of CUPS itself.

I set these options via

lpadmin -p <printer> -o <option>-default=<value>

getting a line

Option <option> <value>

in the entry of <printer>. What works is that these options get supplied
with every job, so I can use such options to configure filters or to get
filters into a debug mode. I am using this successfully for example with
the "usb" CUPS backend to find quirk rules for broken USB printers.

Now I also want to use this simply to mark print queues (setting an
option which is ignored by all filters). For example all queues created
by cups-browsed get the cups-browsed Boolean option set by doing the IPP
equivalent of:

lpadmin -p <printer> -o cups-browsed-default

resulting in a line

Option cups-browsed true

in /etc/cups/printers.conf. This way I want that if cups-browsed not
closed cleanly (system crash) and so did not remove the queues it
created in the next session finds these queues and treats them
correctly, so that crashes do not lead to ghost queues.

Now it seems that I cannot read out this option setting (without sending
a job and checking error_log), as

lpoptions -p <printer>

does not list the option (as "cups-browsed" or "cups-browsed=true") and

val = cupsGetOption("cups-browsed", dest->num_options, dest->options)

in a C program (with dest being the record of the printer in question)
gives val = NULL as one gets when requesting the value of a non-existing
option.

In CUPS 1.5.x (Ubuntu Precise, 12.04 LTS) this still worked. both
cups-browsed was able to read out the "cups-browsed" marker option from
its queues via the C line shown above and

lpoptions -p <printer>

contains "cups-browsed=true" in its output.

I have reported this bug upstream (Apple bug <rdar://problem/14401795>) and Mike Sweet, author of CUPS has supplied the attached patch which fixes this bug and the patch actually works for me.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :
Changed in cups (Ubuntu Raring):
status: New → Triaged
importance: Undecided → High
milestone: none → raring-updates
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Patch applies only to CUPS 1.7.x, not 1.6.x.

Changed in cups (Ubuntu Raring):
status: Triaged → Confirmed
Changed in cups (Ubuntu Saucy):
status: Triaged → Confirmed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Sorry, this bug appeared only from CUPS 1.7.x on, 1.6.x as in the official Ubuntu packages is not affected.

The CUPS 1.7.x packages in my PPA for Saucy I have already fixed, the Raring packages will get fixed soon.

Changed in cups (Ubuntu Saucy):
status: Confirmed → Fix Released
Changed in cups (Ubuntu Raring):
status: Confirmed → Triaged
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

CUPS 1.7.x PPA package also updated for Raring.

Changed in cups (Ubuntu Raring):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.