diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index fc2d77ce..0a9228fe 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -1375,6 +1375,7 @@ async fn restore(param: Value) -> Result { pxar::decoder::Decoder::from_std(reader)?, Path::new(target), &[], + true, proxmox_backup::pxar::Flags::DEFAULT, allow_existing_dirs, |path| { diff --git a/src/bin/pxar.rs b/src/bin/pxar.rs index ecd61f11..a3951bb9 100644 --- a/src/bin/pxar.rs +++ b/src/bin/pxar.rs @@ -24,11 +24,13 @@ fn extract_archive_from_reader( allow_existing_dirs: bool, verbose: bool, match_list: &[MatchEntry], + extract_match_default: bool, ) -> Result<(), Error> { proxmox_backup::pxar::extract_archive( pxar::decoder::Decoder::from_std(reader)?, Path::new(target), &match_list, + extract_match_default, feature_flags, allow_existing_dirs, |path| { @@ -162,6 +164,8 @@ fn extract_archive( ); } + let extract_match_default = match_list.is_empty(); + if archive == "-" { let stdin = std::io::stdin(); let mut reader = stdin.lock(); @@ -172,6 +176,7 @@ fn extract_archive( allow_existing_dirs, verbose, &match_list, + extract_match_default, )?; } else { if verbose { @@ -186,6 +191,7 @@ fn extract_archive( allow_existing_dirs, verbose, &match_list, + extract_match_default, )?; } diff --git a/src/pxar/extract.rs b/src/pxar/extract.rs index 8581a8c0..4a2993a0 100644 --- a/src/pxar/extract.rs +++ b/src/pxar/extract.rs @@ -27,6 +27,7 @@ pub fn extract_archive( mut decoder: pxar::decoder::Decoder, destination: &Path, match_list: &[MatchEntry], + extract_match_default: bool, feature_flags: Flags, allow_existing_dirs: bool, mut callback: F, @@ -69,7 +70,7 @@ where ); let mut match_stack = Vec::new(); - let mut current_match = true; + let mut current_match = extract_match_default; while let Some(entry) = decoder.next() { use pxar::EntryKind;