Skip to content

lru_disk_cache crate is a huge footgun #916

@piegamesde

Description

@piegamesde

I just tried out the lru_disk_cache crate because it sounds like it does what I want. However, one can easily corrupt files with it, but this behavior is not documented at all and the type system does not enforce anything.

First of all insert_file silently moves that file into the cache. In other words, it deletes the original. And the documentation does not spare one word on it.

The second issue is, that when using an absolute path as key, it will silently overwrite random files on the file system (outside of the cache). The content of the keys is never checked nor enforced. And I couldn't find any documentation on this either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions