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's behaviour is difference between CUPS2.2.10 & CUPS2.2.12 #5683

Closed
tangyanli opened this issue Nov 13, 2019 · 8 comments
Closed
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@tangyanli
Copy link

Assume the default printer name is set as below:
/etc/cups/printers.conf: PrinterA
~/.cups/lpoptions: PrinterB

When use the cupsGetDests to get the default printer name:
Ubuntu19.04 (CUPS2.2.10): The PrinterB's dest->is_default = 1
Ubuntu19.10 (CUPS2.2.12): The PrinterA's dest->is_default = 1

I tried to analyze the code, is the cups_enum_dests()'s logic changed?
(1) data.def_name stores the system default name ("PrinterA")
(2) Get the use default name from ~/.cups/lpoptions ("PrinterB")
(3) According the data.def_name ("PrinterA") to set the dest->is_default = 1

getDefaultPrinter.txt

@michaelweghorn
Copy link
Contributor

I didn't test yet, but does merge request #5679 make a difference?

@tangyanli
Copy link
Author

CUPS2.2.12 was released at Aug 15. It seems not the #5679 causes the problem.

@michaelweghorn
Copy link
Contributor

CUPS2.2.12 was released at Aug 15. It seems not the #5679 causes the problem.

You're right, #5679 is not even included in any CUPS release, not even in the development version in git. What I meant was that it might possibly fix the issue, since what you describe sounds similar to #5681, and #5679 seemed to fix that one for me in a quick test.

However, I only tested with git master (i.e. CUPS 2.3.X), so your issue might be a different one.

@tangyanli
Copy link
Author

I also found another phenomenon as below:

Assume the default printer name is set as below:
/etc/cups/printers.conf: PrinterA
~/.cups/lpoptions: PrinterB
When use lpoptions to set PrinterC's setting:
lpoptions -p PrinterC -o PageSize=A4

The default printer name recorded in the ~/.cups/lpoptions becomes "PrinterA"

And I tried to fix the cups_enum_dests(), the above phenomenon disappears.
Because I am not familiar with CUPS coding, is the fix OK?

dest.txt

@michaelweghorn
Copy link
Contributor

And I tried to fix the cups_enum_dests(), the above phenomenon disappears.
Because I am not familiar with CUPS coding, is the fix OK?

dest.txt

Is "dest.txt" your modified version that contains the fix? I'm not really familiar with CUPS coding either, but I think that creating a pull request would be a better way to suggest a fix, in particular since other places in the file might change in the meantime, making it hard to see what your actual change was by just looking at the attachment.

@tangyanli
Copy link
Author

It is OK.
I then will test the newest code from the git to check whether the issue still exists or not.
If still exists, I will pull a request.

BTW: the dest.txt (actually dest.c) is changed based on the CUPS2.2.12 release coding. :-)

@michaelrsweet
Copy link
Collaborator

OK, this is a dupe of Issue #5681 - fixes have been pushed to the master and 2.2.x branches.

@michaelrsweet michaelrsweet self-assigned this Nov 14, 2019
@michaelrsweet michaelrsweet added the duplicate This issue or pull request already exists label Nov 14, 2019
@tangyanli
Copy link
Author

I am sorry, I have tested the branch CUPS2.3.x and CUPS2.2x, this issue is not fixed entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants