These reviews are from cargo-vet. To add your review, set up cargo-vet and submit your URL to its registry.

The current version of tempfile is 3.14.0.

3.13.0 (older version) unknown

From kornelski/crev-proofs copy of salsa.debian.org.

Only in debcargo (unstable). Changelog:

  • Package tempfile 3.13.0 from crates.io using debcargo 2.7.1
  • Drop outdated relax-deps.diff

[ Alexander Kjäll ]

  • Team upload.
  • Package tempfile 3.12.0 from crates.io using debcargo 2.6.1

cargo-vet does not verify reviewers' identity. You have to fully trust the source the audits are from.

safe-to-run

This crate can be compiled, run, and tested on a local workstation or in controlled automation without surprising consequences. More…

does-not-implement-crypto (implies crypto-safe)

Inspection reveals that the crate in question does not attempt to implement any cryptographic algorithms on its own.

Note that certification of this does not require an expert on all forms of cryptography: it's expected for crates we import to be "good enough" citizens, so they'll at least be forthcoming if they try to implement something cryptographic. When in doubt, please ask an expert.

crypto-safe
Implied by other criteria

All crypto algorithms in this crate have been reviewed by a relevant expert.

Note: If a crate does not implement crypto, use does-not-implement-crypto, which implies crypto-safe, but does not require expert review in order to audit for.

safe-to-deploy (implies safe-to-run)

This crate will not introduce a serious security vulnerability to production software exposed to untrusted input. More…

unknown

May have been packaged automatically without a review


These reviews are from Crev, a distributed system for code reviews. To add your review, set up cargo-crev.

The current version of tempfile is 3.14.0.

3.3.0 (older version) Rating: Positive Thoroughness: Low Understanding: Medium

Approved without comment by johnlepikhin on 2022-11-04

3.2.0 (older version) Rating: Positive Thoroughness: Low Understanding: Medium

by gitlab.com/chrysn on 2021-03-20

The unsafes all look good and are not trivial to replace (tried the ASCII string composition, but the compiler can't optimize away from_utf8's error by seeing through into the possible random values.

Average understanding is medium, I don't know the APIs underlying the Windows implementation.

3.1.0 (older version) Rating: Positive Thoroughness: Low Understanding: Medium

by dpc on 2019-08-25

LGTM. I feel like this crate could use more in-depth review since it does have some unsafe blocks (especially for Windows).

3.1.0 (older version) Rating: Positive Thoroughness: Medium Understanding: Medium

by MaulingMonkey on 2019-08-14

Solid crate overall.

Concerns:

  • Absurdly high default NUM_RETRIES means this crate can hang.
  • Slightly unnecessarily large unsafe use, used once without clear need.
  • TempDir seems like a big footgun.
  • Well documented footguns with regards to share tmp dirs on some systems.
  • Hazard to reproducable builds thanks to random filename generation.

Detail

File Rating Notes
src/file/imp/mod.rs +1
src/file/imp/other.rs +1 not_supported
src/file/imp/unix.rs +1 unsafe, but sound.
src/file/imp/windows.rs +1 unsafe, but sound.
src/file/mod.rs +1
src/dir.rs +1
src/error.rs +1
src/lib.rs +1
src/spooled.rs +1 Could use a .into_file()
src/util.rs 0 unsafe, but sound.
tests/namedtempfile.rs +1
tests/spooled.rs +1
tests/tempdir.rs +1
tests/tempfile.rs +1
.gitignore +1
Cargo.toml +1
Cargo.toml.orig +1
LICENSE-APACHE +1
LICENSE-MIT +1
NEWS +1
README.​md +1
Other Rating Notes
unsafe 0 Minor unnecessary/overlong unsafe blocks
fs 0 Rationale of this entire crate
io +1 All looks sane
docs +1 Tons of doc comments
tests +1 Lots of 'em

src/file/imp/unix.rs

Line What Notes
15 cvt_err +1, verified error handling is correct vs online man pages for rename and link.
25 cvt_err +1
30 cstr +1
35 create_named +1
44 create_unlinked +1
62 create +1, sane flag use.
79 create +1
83 create_unix +1, minor hazard to reproducable builds due to random filenames
93 reopen +1
107 persist 0, unsafe larger than necessary, but sound.
130 persist 0, redox NYI but sane placeholder error
135 keep 0, nothing to do on unix

src/file/imp/windows.rs

Line What Notes
19 to_utf16 +1, null terminates
23 create_named +1
32 create +1, minor hazard to reproducable builds due to random filenames
50 reopen +1, unsafe but sound. Verified error handling vs MSDN.
67 keep +1, unsafe but sound. Verified error handling vs MSDN.
78 persist 0, unsafe larger than necessary, but sound. Verified error handling vs MSDN.

src/file/mod.rs

Line What Notes
... * +1, well reviewed despite my lack of notes.
587 new_in +1, doc comment links wrong method (new_in instead of new)
... * +1, well reviewed despite my lack of notes.
859 into_file 0, confusing how to use these correctly as Drop still occurs
867 into_temp_path 0, confusing how to use these correctly as Drop still occurs
876 into_parts 0, confusing how to use these correctly as Drop still occurs
... * +1, well reviewed despite my lack of notes.

src/lib.rs

Line What Notes
... * +1, well reviewed despite my lack of notes.
131 NUM_RETRIES -1, absurdly large default value 1 << 31, will hang "forever".
... * +1, well reviewed despite my lack of notes.

src/util.rs

Line What Notes
9 tmpname 0, unsafe for semi-pointless str::from_utf8_unchecked, but sound. Reproducable builds hazard.
26 create_helper +1, although I'd pick a different error message.

TIL

let tmp;
if cond {
    tmp = asdf;
    &tmp
}
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    f.debug_struct("TempDir")
        .field("path", &self.path())
        .finish()
}

3.0.4 (older version) Rating: Positive Thoroughness: Low Understanding: Medium

by dpc on 2018-12-26

Show review…

LGTM. I feel like this crate could use more in-depth review since it does have some unsafe blocks (especially for Windows).


Lib.rs has been able to verify that all files in the crate's tarball are in the crate's repository with a git tag matching the version. Please note that this check is still in beta, and absence of this confirmation does not mean that the files don't match.

Crates in the crates.io registry are tarball snapshots uploaded by crates' publishers. The registry is not using crates' git repositories, so there is a possibility that published crates have a misleading repository URL, or contain different code from the code in the repository.

To review the actual code of the crate, it's best to use cargo crev open tempfile. Alternatively, you can download the tarball of tempfile v3.14.0 or view the source online.