public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
To: Maximiliano Sandoval <m.sandoval@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH pve-cluster v2 3/3] Create temporary CSR file in /run instead of /tmp
Date: Tue, 17 Mar 2026 15:25:32 +0100	[thread overview]
Message-ID: <rdljwkro3fguexfh6kbsycfejnvqmifuvvkt3zgoybd2i4yvc5@3fqu7oijl33d> (raw)
In-Reply-To: <s8o7brad0e6.fsf@toolbox>

On Tue, Mar 17, 2026 at 02:57:21PM +0100, Maximiliano Sandoval wrote:
> Arthur Bied-Charreton <a.bied-charreton@proxmox.com> 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 <s.ivanov@proxmox.com>
> > Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
> > ---
> >  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




  reply	other threads:[~2026-03-17 14:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-26  9:55 [pve-devel] [PATCH pve-cluster v2 0/3] fix #6701: Update PVE cert generation Arthur Bied-Charreton
2026-01-26  9:55 ` [pve-devel] [PATCH pve-cluster v2 1/3] fix #6701: Add keyUsage extension to root CA Arthur Bied-Charreton
2026-03-17 12:58   ` Maximiliano Sandoval
2026-03-17 14:26     ` Arthur Bied-Charreton
2026-01-26  9:55 ` [pve-devel] [PATCH pve-cluster v2 2/3] Convert SSL cert generation config to CLI arguments Arthur Bied-Charreton
2026-01-26  9:55 ` [pve-devel] [PATCH pve-cluster v2 3/3] Create temporary CSR file in /run instead of /tmp Arthur Bied-Charreton
2026-03-17 13:57   ` Maximiliano Sandoval
2026-03-17 14:25     ` Arthur Bied-Charreton [this message]
2026-02-06 11:35 ` [pve-devel] [PATCH pve-cluster v2 0/3] fix #6701: Update PVE cert generation Stoiko Ivanov
2026-03-17 12:50 ` Arthur Bied-Charreton
2026-03-17 14:27 ` superseded: " Arthur Bied-Charreton

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=rdljwkro3fguexfh6kbsycfejnvqmifuvvkt3zgoybd2i4yvc5@3fqu7oijl33d \
    --to=a.bied-charreton@proxmox.com \
    --cc=m.sandoval@proxmox.com \
    --cc=pve-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