all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: Arthur Bied-Charreton <a.bied-charreton@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 14:57:21 +0100	[thread overview]
Message-ID: <s8o7brad0e6.fsf@toolbox> (raw)
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")

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?

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 13:57 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 [this message]
2026-03-17 14:25     ` Arthur Bied-Charreton
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=s8o7brad0e6.fsf@toolbox \
    --to=m.sandoval@proxmox.com \
    --cc=a.bied-charreton@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal