1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 11:41:15 +02:00

Validate tarball components

This commit is contained in:
Eelco Dolstra 2019-12-13 18:11:37 +01:00
parent 4581159e3f
commit 5a6d6da7ae
5 changed files with 27 additions and 5 deletions

View file

@ -23,6 +23,7 @@ pub enum Error {
HttpError(hyper::error::Error),
Misc(String),
Foreign(CppException),
BadTarFileMemberName(String),
}
impl From<std::io::Error> for Error {
@ -64,6 +65,9 @@ impl fmt::Display for Error {
Error::HttpError(err) => write!(f, "HTTP error: {}", err),
Error::Foreign(_) => write!(f, "<C++ exception>"), // FIXME
Error::Misc(s) => write!(f, "{}", s),
Error::BadTarFileMemberName(s) => {
write!(f, "tar archive contains illegal file name '{}'", s)
}
}
}
}