public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup v2 2/5] bin: daily update: refactor to use proxmox-product-config
Date: Wed,  1 Jul 2026 11:46:39 +0200	[thread overview]
Message-ID: <20260701094642.23895-3-c.ebner@proxmox.com> (raw)
In-Reply-To: <20260701094642.23895-1-c.ebner@proxmox.com>

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 <c.ebner@proxmox.com>
---
 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





  parent reply	other threads:[~2026-07-01  9:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01  9:46 [PATCH proxmox-backup v2 0/5] fix 7642: avoid expensive uid/gid lookups for lock- and config-files Christian Ebner
2026-07-01  9:46 ` [PATCH proxmox-backup v2 1/5] bin: api: early init proxmox-product-config Christian Ebner
2026-07-01  9:46 ` Christian Ebner [this message]
2026-07-01  9:46 ` [PATCH proxmox-backup v2 3/5] pbs-config: use proxmox-product-config::replace_secret_config() Christian Ebner
2026-07-01  9:46 ` [PATCH proxmox-backup v2 4/5] pbs-config: use proxmox-product-config::replace_config() Christian Ebner
2026-07-01  9:46 ` [PATCH proxmox-backup v2 5/5] fix #7642: avoid expensive user lookups on file locking Christian Ebner
2026-07-01 14:06 ` superseded: [PATCH proxmox-backup v2 0/5] fix 7642: avoid expensive uid/gid lookups for lock- and config-files Christian Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260701094642.23895-3-c.ebner@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal