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 236A01FF13E for ; Wed, 01 Jul 2026 16:04:29 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 67FA2213A3; Wed, 01 Jul 2026 16:04:28 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup v3 02/15] bin: daily update: refactor to use proxmox-product-config Date: Wed, 1 Jul 2026 16:03:59 +0200 Message-ID: <20260701140412.200920-3-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: 1782914659967 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.000 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: KS4K7LTIGP2DNMDJR5L3VX75ABKUB6IF X-Message-ID-Hash: KS4K7LTIGP2DNMDJR5L3VX75ABKUB6IF 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: Switch to use the generic proxmox-product-config helpers for the daily update binary. This follows along the lines of what Proxmox Datacenter Manager does. The create option permissions for rest server worker task init are now implicitly set to 0640 via the default_create_options() helper, the worker task setting them as required on-demand. Signed-off-by: Christian Ebner --- src/bin/proxmox-daily-update.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/bin/proxmox-daily-update.rs b/src/bin/proxmox-daily-update.rs index 42ce62d16..597722497 100644 --- a/src/bin/proxmox-daily-update.rs +++ b/src/bin/proxmox-daily-update.rs @@ -4,7 +4,6 @@ use serde_json::json; use proxmox_notify::context::pbs::PBS_CONTEXT; use proxmox_router::{ApiHandler, RpcEnvironment, cli::*}; use proxmox_subscription::SubscriptionStatus; -use proxmox_sys::fs::CreateOptions; use pbs_buildcfg::configdir; use proxmox_backup::api2; @@ -91,16 +90,15 @@ async fn check_acme_certificates(rpcenv: &mut dyn RpcEnvironment) -> Result<(), } async fn run(rpcenv: &mut dyn RpcEnvironment) -> Result<(), Error> { - let backup_user = pbs_config::backup_user()?; - let file_opts = CreateOptions::new() - .owner(backup_user.uid) - .group(backup_user.gid); + proxmox_product_config::init(pbs_config::backup_user()?, pbs_config::priv_user()?); proxmox_rest_server::init_worker_tasks( pbs_buildcfg::PROXMOX_BACKUP_LOG_DIR_M!().into(), - file_opts, + proxmox_product_config::default_create_options(), )?; - let mut command_sock = proxmox_daemon::command_socket::CommandSocket::new(backup_user.gid); + let mut command_sock = proxmox_daemon::command_socket::CommandSocket::new( + proxmox_product_config::get_api_user().gid, + ); proxmox_rest_server::register_task_control_commands(&mut command_sock)?; command_sock.spawn(proxmox_rest_server::last_worker_future())?; -- 2.47.3