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 A3D281FF137 for ; Tue, 17 Mar 2026 14:57:16 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9B3E1F193; Tue, 17 Mar 2026 14:57:27 +0100 (CET) From: Maximiliano Sandoval To: Arthur Bied-Charreton Subject: Re: [pve-devel] [PATCH pve-cluster v2 3/3] Create temporary CSR file in /run instead of /tmp In-Reply-To: <20260126100534.86882-8-a.bied-charreton@proxmox.com> (Arthur Bied-Charreton's message of "Mon, 26 Jan 2026 10:55:47 +0100") References: <20260126100534.86882-3-a.bied-charreton@proxmox.com> <20260126100534.86882-8-a.bied-charreton@proxmox.com> User-Agent: mu4e 1.12.9; emacs 30.1 Date: Tue, 17 Mar 2026 14:57:21 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773755800417 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.943 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.408 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.819 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.903 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: 7ZKPDI4TXRM5PYFW3UGT3KXIYP2OB4M2 X-Message-ID-Hash: 7ZKPDI4TXRM5PYFW3UGT3KXIYP2OB4M2 X-MailFrom: m.sandoval@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: 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? 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