[linux] Tests: an archive made with 'tar -C dir -czf x .' (a ./ root entry) is accepted (red: found by the systemd container test)
This commit is contained in:
@@ -223,6 +223,11 @@ fn archive_entries_stay_inside_the_release() {
|
||||
check_entry(EntryKind::File, "bin/shop", 10).unwrap();
|
||||
check_entry(EntryKind::Dir, "static/", 0).unwrap();
|
||||
check_entry(EntryKind::File, "./README", 10).unwrap();
|
||||
// `tar -C dir -czf x.tar.gz .` writes the root itself as `./`: allowed, and it names nothing.
|
||||
assert!(check_entry(EntryKind::Dir, "./", 0).unwrap().is_empty());
|
||||
assert!(check_entry(EntryKind::Dir, ".", 0).unwrap().is_empty());
|
||||
assert!(check_entry(EntryKind::File, "./", 0).is_err());
|
||||
assert!(check_entry(EntryKind::File, ".", 0).is_err());
|
||||
for (kind, path) in [
|
||||
(EntryKind::File, "/etc/passwd"),
|
||||
(EntryKind::File, "../outside"),
|
||||
|
||||
Reference in New Issue
Block a user