From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 9E03B1FF14C for ; Fri, 15 May 2026 11:06:48 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E2C4512495; Fri, 15 May 2026 11:06:47 +0200 (CEST) From: Thomas Lamprecht To: Lukas Wagner Subject: Re: [PATCH datacenter-manager 2/4] add api_cache as a specialized wrapper around the namespaced cache Date: Fri, 15 May 2026 11:06:30 +0200 Message-ID: <20260515090637.950992-2-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260513135457.573414-3-l.wagner@proxmox.com> References: <20260513135457.573414-1-l.wagner@proxmox.com> <20260513135457.573414-3-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778835997379 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.004 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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: Y3J44RA3PAP64Y2A6PNKSVO34A6UNYAI X-Message-ID-Hash: Y3J44RA3PAP64Y2A6PNKSVO34A6UNYAI X-MailFrom: t.lamprecht@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 CC: pdm-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 13 May 2026 15:54:55 +0200, Lukas Wagner wrote:=0D > diff --git a/server/src/api_cache.rs b/server/src/api_cache.rs=0D > new file mode 100644=0D > --- /dev/null=0D > +++ b/server/src/api_cache.rs=0D > @@ -0,0 +1,126 @@=0D [...]=0D > +const GLOBAL_NAMESPACE: &str =3D "global";=0D > +const LOCK_TIMEOUT: Duration =3D Duration::from_secs(10);=0D > +=0D > +static CACHE: LazyLock =3D LazyLock::new(|| {=0D > + let file_options =3D proxmox_product_config::default_create_options(= );=0D > + let dir_options =3D file_options.perm(Mode::from_bits_truncate(0o750= ));=0D =0D w.r.t. 0o750 mode for per-namespace subdirectories here and ...=0D =0D > +=0D > + NamespacedCache::new(PathBuf::from(PDM_API_CACHE_PATH), dir_options,= file_options)=0D > +});=0D =0D > diff --git a/server/src/bin/proxmox-datacenter-privileged-api.rs b/server= /src/bin/proxmox-datacenter-privileged-api.rs=0D > --- a/server/src/bin/proxmox-datacenter-privileged-api.rs=0D > +++ b/server/src/bin/proxmox-datacenter-privileged-api.rs=0D > @@ -102,6 +102,13 @@ fn create_directories() -> Result<(), Error> {=0D [...]=0D > + pdm_config::setup::mkdir_perms(=0D > + api_cache::PDM_API_CACHE_PATH,=0D > + api_user.uid,=0D > + api_user.gid,=0D > + 0o755,=0D > + )?;=0D =0D .. the cache root is created with 0o755 here - is that on purpose? With=0D the current modes any local user can list the cache root and see which=0D remotes have cached data from the directory names, even though they=0D cannot read the cached contents. Either drop the root to 0o750 to match,=0D or add a short comment explaining why the two levels differ.=0D