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

Global database configuration is ignored when advisories are locally configured #1073

Open
Nemo157 opened this issue Nov 28, 2023 · 0 comments

Comments

@Nemo157
Copy link

Nemo157 commented Nov 28, 2023

> cat $CARGO_HOME/audit.toml
# smh cargo-audit, get your own dirs, stop borrowing cargo's
[database]
path = "/home/nemo157/.cache/cargo-audit/advisory-db"
fetch = false
stale = false

> cat .cargo/audit.toml
[advisories]
ignore = [
    "RUSTSEC-2020-0036", # failure is officially deprecated/unmaintained
    # https://github.com/rust-lang/docs.rs/issues/1014

    "RUSTSEC-2023-0018", # rustwide -> remove_dir_all,TOCTOU / Race Condition
    # https://github.com/rust-lang/docs.rs/issues/2074
]
informational_warnings = ["unmaintained"] # warn for categories of informational advisories
severity_threshold = "low" # CVSS severity ("none", "low", "medium", "high", "critical")

[output]
quiet = false
deny = ["unmaintained"] # yanked is allowed for now

> cargo audit
    Fetching advisory database from `https://github.com/RustSec/advisory-db.git`
error: couldn't fetch advisory database: git operation failed: failed to make directory '/run/user/1000/cargo-home/advisory-db': Permission denied; class=Os (2)

> rm .cargo/audit.toml

> cargo audit
    Fetching advisory database from `https://github.com/RustSec/advisory-db.git`
      Loaded 580 security advisories (from /home/nemo157/.cache/cargo-audit/advisory-db)
...

> cargo audit --version
cargo-audit 0.17.6

Also reproduced with cargo-audit 0.18.2, the error message is just about not being able to acquire the lock instead.

(For context: I have a read-only $CARGO_HOME with all of Cargo's directories linked out to more "correct" locations, I am now trying to get all the third-party tools that have been dumping their files in there to also use the directories they should have been).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant