mirror of
https://github.com/NixOS/nix
synced 2025-06-26 11:41:15 +02:00
Validate tarball components
This commit is contained in:
parent
4581159e3f
commit
5a6d6da7ae
5 changed files with 27 additions and 5 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue