public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Maximiliano Sandoval <m.sandoval@proxmox.com>
Subject: [pbs-devel] applied: [PATCH pbs-client v5] fix #3699: client: prefer xdg cache directory for tmp files
Date: Wed, 17 Jul 2024 13:40:21 +0200	[thread overview]
Message-ID: <ef72786c-20ab-4132-920d-7fe236452e38@proxmox.com> (raw)
In-Reply-To: <20240717101835.1364712-1-m.sandoval@proxmox.com>

Am 17/07/2024 um 12:18 schrieb Maximiliano Sandoval:
> Adds a helper to create temporal files in XDG_CACHE_HOME. If we cannot
> create a file there, we fallback to /tmp as before.
> 
> Note that the temporary files stored by the client might grow
> arbitrarily in size, making XDG_RUNTIME_DIR a less desirable option.
> Citing the Arch wiki [1]:
> 
>> Should not store large files as it may be mounted as a tmpfs.
> 
> [1] https://wiki.archlinux.org/title/XDG_Base_Directory
> 
> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
> ---
> 
> Differences from v4:
>  - Use backticks in documentation for `/tmp` and `XDG_CACHE_HOME`
> 
> Differences from v3:
>  - Link create_tmp_file in docs
>  - Improve commit message
> 
> Differences from v2:
>  - Files are created at XDG_CACHE_HOME directly
>  - If opening fails, we try opening at /tmp
>  - We check if the directory exists as part of the error handling of open()
> 
>  pbs-client/src/backup_reader.rs      | 31 ++++++++--------------------
>  pbs-client/src/backup_writer.rs      | 13 ++----------
>  pbs-client/src/tools/mod.rs          | 26 +++++++++++++++++++++++
>  proxmox-backup-client/src/catalog.rs | 19 +++--------------
>  4 files changed, 40 insertions(+), 49 deletions(-)
> 
>

applied, thanks!

Made a small addition to the commit message to explain why we do not need
to bother with clean up when some operation does not finish cleanly (error,
user interrupt, ...), i.e. due to O_TMPFILE being set; IMO that's good to
state as it's both important in general (to avoid leaking data to others)
and also using directories that normally persist a reboot.

btw. Wolfgang mentioned that it might make sense to have a fallback for the
case where O_TMPFILE is not supported.
While your patch did not introduce using O_TMPFILE, it's probably more
likely to make problems now,  e.g. if the home directory is backed by NFS,
which is quite common in some sectors/orgs (e.g. universities).


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


      reply	other threads:[~2024-07-17 11:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-17 10:18 [pbs-devel] " Maximiliano Sandoval
2024-07-17 11:40 ` Thomas Lamprecht [this message]

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=ef72786c-20ab-4132-920d-7fe236452e38@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=m.sandoval@proxmox.com \
    --cc=pbs-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