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

cupd-driverd does not recognize when PPD entries for *.drv are already cached in ppds.dat #3921

Closed
michaelrsweet opened this issue Aug 17, 2011 · 5 comments

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.5.0
CUPS.org User: till.kamppeter

When requesting a list of the available PPDs ("lpinfo -m") cups-driverd at first reads the file /var/cache/cups/ppds.dat with PPD entries which it had already loaded on an earlier run. There it caches not only ready-made (static) PPDs but also PPDs which get generated on-the-fly based on the data in /usr/share/cups/drv/*.drv files. To mark in the cache that the entries from a given *.drv file are already there, it adds a dummy entry for the cache so that when loading the cache it only needs to verify the dummy entry. Due to a bug this entry does not get found and so all already existing PPD entries from the *.drv file get generated and added again, which messes up the PPD list leading to a loss of hundreds of PPD entries, making many printers appearing unsupported in printer setup tools.

Attached is a patch which makes the dummy entry being written correctly so that cups-driverd finds it. With this correct PPD lists get generated.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: till.kamppeter

I have seen that you did not mirror the fix into 1.5.x yet. Will you do so?

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Till, the fix was applied to the 1.5 branch in r9939 (along with a bunch of others - unless I am just fixing a single bug I usually batch all of the mirrored changes from trunk in one commit...)

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: till.kamppeter

I have found it now, sorry.

@michaelrsweet
Copy link
Collaborator Author

"cups-driverd-recognize-cached-drv-generated-ppds.patch":

--- a/scheduler/cups-driverd.cxx
+++ b/scheduler/cups-driverd.cxx
@@ -1401,9 +1401,7 @@

  • Add a dummy entry for the file...
    */
  • httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "drv", "", "", 0,
  •      "/%s", name);
    
  • add_ppd(name, uri, "", "", "", "", "", "", mtime, size, 0,
  • add_ppd(name, name, "", "", "", "", "", "", mtime, size, 0,
    PPD_TYPE_DRV, "drv");
    ChangedPPD = 1;

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

1 participant