From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 451331FF137 for ; Tue, 17 Mar 2026 15:25:26 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BC17010371; Tue, 17 Mar 2026 15:25:37 +0100 (CET) Date: Tue, 17 Mar 2026 15:25:32 +0100 From: Arthur Bied-Charreton To: Maximiliano Sandoval Subject: Re: [pve-devel] [PATCH pve-cluster v2 3/3] Create temporary CSR file in /run instead of /tmp Message-ID: References: <20260126100534.86882-3-a.bied-charreton@proxmox.com> <20260126100534.86882-8-a.bied-charreton@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773757492805 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.850 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: KYF2KX23D7Y7V6NN6447I6BDYBK2GCFN X-Message-ID-Hash: KYF2KX23D7Y7V6NN6447I6BDYBK2GCFN X-MailFrom: a.bied-charreton@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: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, Mar 17, 2026 at 02:57:21PM +0100, Maximiliano Sandoval wrote: > Arthur Bied-Charreton writes: > > > Creating temp files in a world-writable directory such as /tmp could expose > > the config generation to symlink races. Use /run directory instead. > > > > As suggested here: > > https://lore.proxmox.com/pve-devel/20260123195300.0ae7fcc9@rosa.proxmox.com/T/#t > > > > Suggested-by: Stoiko Ivanov > > Signed-off-by: Arthur Bied-Charreton > > --- > > src/PVE/Cluster/Setup.pm | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/src/PVE/Cluster/Setup.pm b/src/PVE/Cluster/Setup.pm > > index b9cacfd..5ed85ad 100644 > > --- a/src/PVE/Cluster/Setup.pm > > +++ b/src/PVE/Cluster/Setup.pm > > @@ -504,7 +504,7 @@ sub gen_pve_ssl_cert { > > $names .= ",DNS:$fqdn"; > > } > > > > - my $reqfn = "/tmp/pvecertreq-$$.tmp"; > > + my $reqfn = "/run/pvecertreq-$$.tmp"; > > Note that the cluster filesystem already creates a RUNDIR owned by > root:www-data with 710 permissions under /run/pve-cluster. > > Perhaps that is more appropriate? Did not know about this, thanks! Sent a v3: https://lore.proxmox.com/pve-devel/20260317142206.482976-1-a.bied-charreton@proxmox.com/T/#u > > NOTE: It is a bit odd that in the pmxcfs.c there is an explicit call > mkdir(RUNDIR, 0755), but in practice it appears as 710. > > > unlink $reqfn; > > > > my $pvessl_key_fn = "$pmxcfs_base_dir/nodes/$nodename/pve-ssl.key"; > > -- > Maximiliano