From cbf7bbefb73d43a4265758cbc7f9f5fc81c13771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 8 Oct 2024 10:33:55 +0200 Subject: [PATCH] pxar: extract: make invalid ACLs non-fatal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit these can occur in practice, and neither setting nor getting them throws an error. if "invalid" ACLs are non-restorable, this means that creating a pxar archive with such an ACL is possible, but restoring it isn't. reported in our community forum: https://forum.proxmox.com/threads/155477 Tested-by: Gabriel Goller Acked-by: Thomas Lamprecht Signed-off-by: Fabian Grünbichler --- pbs-client/src/pxar/metadata.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pbs-client/src/pxar/metadata.rs b/pbs-client/src/pxar/metadata.rs index 07154709..ad633215 100644 --- a/pbs-client/src/pxar/metadata.rs +++ b/pbs-client/src/pxar/metadata.rs @@ -2,7 +2,7 @@ use std::ffi::{CStr, CString}; use std::os::unix::io::{AsRawFd, RawFd}; use std::path::Path; -use anyhow::{anyhow, bail, Context, Error}; +use anyhow::{anyhow, Context, Error}; use nix::errno::Errno; use nix::fcntl::OFlag; use nix::sys::stat::Mode; @@ -300,7 +300,7 @@ fn apply_acls( } if !acl.is_valid() { - bail!("Error while restoring ACL - ACL invalid"); + log::warn!("Warning: {path_info:?} - ACL invalid, attempting restore anyway.."); } acl.set_file(c_proc_path, acl::ACL_TYPE_ACCESS)?; @@ -329,7 +329,7 @@ fn apply_acls( } if !acl.is_valid() { - bail!("Error while restoring ACL - ACL invalid"); + log::warn!("Warning: {path_info:?} - ACL invalid, attempting restore anyway.."); } acl.set_file(c_proc_path, acl::ACL_TYPE_DEFAULT)?;