Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cupsGetDests applies lpoptions while cupsEnumDests does not #5144

Closed
albert-astals-cid-kdab opened this issue Oct 16, 2017 · 8 comments
Closed
Assignees
Milestone

Comments

@albert-astals-cid-kdab
Copy link
Contributor

It seems to me that calling cupsGetDests applies lpoptions while cupsEnumDests does not.

I have
$ cat .cups/lpoptions
Dest HP_DeskJet_3630_series OutputMode=Photo

And when running the code at [1], i get the output at [2], note how the printouts are exactly the same except for the OutputMode being High-Resolution Photo in one and Normal in the other.

Is this the expected behaviour?

[1] https://pastebin.com/raw/Pft0Xm0h
[2] https://pastebin.com/raw/akNZPWCP

@michaelrsweet
Copy link
Collaborator

@albert-astals-cid-kdab cupsEnumDests should be applying the defaults for manually-added queues but won't for remote (discovered) queues that haven't been added yet. Do you have a queue listed in /etc/cups/printers.conf?

@albert-astals-cid-kdab
Copy link
Contributor Author

albert-astals-cid-kdab commented Oct 19, 2017

Sorry bit of a newbie, not sure what a queue listed means, here [slightly redacted] contents of my /etc/cups/printers.conf

<Printer HP_Deskjet_3050A_J611_series>
UUID urn:uuid:SOME_UUID
Info HP Deskjet 3050A J611 series
Location SOME_LOCATION
MakeModel HP Deskjet 3050a j611 Series hpijs, 3.17.4
DeviceURI usb://HP/Deskjet%203050A%20J611%20series?serial=SOME_SERIAL&interface=1
State Idle
StateTime 1496763749
ConfigTime 1496763749
Type 8425484
Accepting Yes
Shared No
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
</Printer>
<Printer HP_DeskJet_3630_series>
UUID urn:uuid:OTHER_UUID
Info HP DeskJet 3630 series
Location OTHER_LOCATION
MakeModel HP Deskjet 3630 Series, hpcups 3.17.7
DeviceURI hp:/usb/DeskJet_3630_series?serial=OTHER_SERIAL
State Idle
StateTime 1504593829
ConfigTime 1504593774
Type 4108
Accepting Yes                                                                                                                                                                                                                                                                  
Shared Yes                                                                                                                                                                                                                                                                     
JobSheets none none                                                                                                                                                                                                                                                            
QuotaPeriod 0                                                                                                                                                                                                                                                                  
PageLimit 0                                                                                                                                                                                                                                                                    
KLimit 0                                                                                                                                                                                                                                                                       
OpPolicy default                                                                                                                                                                                                                                                               
ErrorPolicy stop-printer                                                                                                                                                                                                                                                       
</Printer>  

@michaelrsweet
Copy link
Collaborator

OK, both of those printers are local USB queues and should be reported correctly - cupsEnumDests uses the same private API to report those printers as cupsGetDests2.

Investigating...

@michaelrsweet
Copy link
Collaborator

@albert-astals-cid-kdab Oh, just to confirm what version of CUPS are you using?

@albert-astals-cid-kdab
Copy link
Contributor Author

2.2.5

@michaelrsweet
Copy link
Collaborator

Hmm....

@michaelrsweet michaelrsweet self-assigned this Oct 20, 2017
@michaelrsweet michaelrsweet added this to the CUPS 2.2.x Updates milestone Oct 20, 2017
@michaelrsweet michaelrsweet modified the milestones: CUPS 2.2.x Updates, CUPS 2.3.x Release Oct 30, 2017
@michaelrsweet
Copy link
Collaborator

OK, I've located the problem and am putting together a fix...

michaelrsweet pushed a commit that referenced this issue Dec 14, 2017
files (Issue #5144)

cups/dest.c:
- Add destination array for lpoptions destinations and options.
- Move application of options from _cupsGetDests to cups_enum_dests.
- Update cups_get_dests to offer a "load all" mode.

cups/testdest.c:
- Show the default destination
- Add --get.
@michaelrsweet
Copy link
Collaborator

[master c5f5c5a] The cupsEnumDests function did not include options from the lpoptions files (Issue #5144)

michaelrsweet added a commit that referenced this issue Mar 7, 2018
- Fixed a compile issue when PAM is not available (Issue #5253)
- Documentation fixes (Issue #5252)
- Star Micronics printers need the "unidir" USB quirk rule (Issue #5251)
- The scheduler now supports using temporary print queues for older IPP/1.1 print queues like those shared by CUPS 1.3 and earlier (Issue #5241)
- The `cupsRasterWritePixels` function did not correctly swap bytes for some formats (Issue #5225)
- Added a USB quirk rule for Canon MP280 series printers (Issue #5221)
- The `ppdInstallableConflict` tested too many constraints (Issue #5213)
- More fixes for printing to old CUPS servers (Issue #5211)
- The `cupsCopyDest` function now correctly copies the `is_default` value (Issue #5208)
- The scheduler did not work with older versions of uClibc (Issue #5188)
- The scheduler now substitutes default values for invalid job attributes when running in "relaxed conformance" mode (Issue #5186)
- Fixed PAM module detection and added support for the common PAM definitions (Issue #5185)
- Fixed a journald support bug in the scheduler (Issue #5181)
- The cups-driverd program incorrectly stopped scanning PPDs as soon as a loop was seen (Issue #5170)
- Fixed group validation on OpenBSD (Issue #5166)
- Fixed the `ippserver` sample code when threading is disabled or unavailable (Issue #5154)
- The `cupsEnumDests` function did not include options from the lpoptions files (Issue #5144)
- The `SSLOptions` directive now supports `MinTLS` and `MaxTLS` options to control the minimum and maximum TLS versions that will be allowed, respectively (Issue #5119)
- The scheduler did not write out dirty configuration and state files if there were open client connections (Issue #5118)
- The `lpadmin` command now provides a better error message when an unsupported System V interface script is used (Issue #5111)
- The `lp` and `lpr` commands now provide better error messages when the default printer cannot be found (Issue #5096)
- No longer support backslash, question mark, or quotes in printer names (Issue #4966)
- The CUPS library now supports the latest HTTP Digest authentication specification including support for SHA-256 (Issue #4862)
- The `lpstat` command now reports when new jobs are being held (Issue #4761)
- The `lpoptions` command incorrectly saved default options (Issue #4717)
- The `ppdLocalizeIPPReason` function incorrectly returned a localized version of "none" (rdar://36566269)
- TLS connections now properly timeout (rdar://34938533)
- The IPP backend did not properly detect failed PDF prints (rdar://34055474)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants