This commit is contained in:
topjohnwu
2024-04-16 19:45:01 -07:00
parent b22b6a4204
commit 7c88484d64
2 changed files with 7 additions and 6 deletions

View File

@ -407,7 +407,8 @@ impl Cpio {
let rdevmajor: dev_t;
let rdevminor: dev_t;
let mode = if attr.is_file() {
// Treat symlinks as regular files as symlinks are created by the 'ln TARGET ENTRY' command
let mode = if attr.is_file() || attr.is_symlink() {
rdevmajor = 0;
rdevminor = 0;
file.open(O_RDONLY | O_CLOEXEC)?.read_to_end(&mut content)?;