From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id A57EF1FF13E for ; Wed, 01 Jul 2026 16:04:35 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9461621422; Wed, 01 Jul 2026 16:04:34 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup v3 13/15] tape: use proxmox-product-config lock file create options Date: Wed, 1 Jul 2026 16:04:10 +0200 Message-ID: <20260701140412.200920-14-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260701140412.200920-1-c.ebner@proxmox.com> References: <20260701140412.200920-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1782914662896 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.048 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: MHFLLIVXROXB7P7X5ZZ3BQE7UGJXTQ5N X-Message-ID-Hash: MHFLLIVXROXB7P7X5ZZ3BQE7UGJXTQ5N X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Instead of redefining them, use the global helper defined in proxmox-product-config. Requires the crates init function to be called exactly once before using in any callpath. Signed-off-by: Christian Ebner --- src/tape/drive/mod.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/tape/drive/mod.rs b/src/tape/drive/mod.rs index 66182a63d..b717aa71d 100644 --- a/src/tape/drive/mod.rs +++ b/src/tape/drive/mod.rs @@ -4,7 +4,6 @@ use std::path::PathBuf; use anyhow::{Error, bail, format_err}; use nix::fcntl::OFlag; -use nix::sys::stat::Mode; use serde::Deserialize; use serde_json::Value; use tracing::info; @@ -604,17 +603,11 @@ fn open_device_lock(device_path: &str) -> Result { let mut path = std::path::PathBuf::from(crate::tape::DRIVE_LOCK_DIR); path.push(lock_name); - let user = pbs_config::backup_user()?; - let options = CreateOptions::new() - .perm(Mode::from_bits_truncate(0o660)) - .owner(user.uid) - .group(user.gid); - atomic_open_or_create_file( path, OFlag::O_RDWR | OFlag::O_CLOEXEC | OFlag::O_APPEND, &[], - options, + proxmox_product_config::lockfile_create_options(), false, ) } -- 2.47.3