[linux] The systemd container test runs, and a ./ root entry no longer blocks a release (v0.1.1) #2
@@ -52,7 +52,7 @@ impl ArchiveError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check one entry and return its path as plain components (no `.`, never empty).
|
/// Check one entry and return its path as plain components (no `.`; empty only for the root dir).
|
||||||
pub fn check_entry(kind: EntryKind, path: &str, size: u64) -> Result<Vec<String>, ArchiveError> {
|
pub fn check_entry(kind: EntryKind, path: &str, size: u64) -> Result<Vec<String>, ArchiveError> {
|
||||||
match kind {
|
match kind {
|
||||||
EntryKind::File | EntryKind::Dir => {}
|
EntryKind::File | EntryKind::Dir => {}
|
||||||
@@ -78,7 +78,9 @@ pub fn check_entry(kind: EntryKind, path: &str, size: u64) -> Result<Vec<String>
|
|||||||
c => parts.push(c.to_owned()),
|
c => parts.push(c.to_owned()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if parts.is_empty() {
|
// The release's own root (`./`, as `tar -C dir -czf x .` writes it) names nothing: allowed for a
|
||||||
|
// directory, refused for anything else.
|
||||||
|
if parts.is_empty() && kind != EntryKind::Dir {
|
||||||
return Err(ArchiveError::Path);
|
return Err(ArchiveError::Path);
|
||||||
}
|
}
|
||||||
Ok(parts)
|
Ok(parts)
|
||||||
|
|||||||
Reference in New Issue
Block a user