public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH backup v3 1/2] http_client: store tickets in the user's config directory
Date: Fri, 18 Apr 2025 14:47:21 +0200	[thread overview]
Message-ID: <s8ott6liq4q.fsf@proxmox.com> (raw)
In-Reply-To: <af6e3b28-768d-424e-ada7-ce9d7977362e@proxmox.com>


Thomas Lamprecht <t.lamprecht@proxmox.com> writes:

> Am 16.04.25 um 14:56 schrieb Maximiliano Sandoval:
>> The environment variable XDG_RUNTIME_DIR is only set if the user is
>> logged into a seat. If, for example, the backup client was run with
>> `sudo` then the ticket would not be a stored.
>> 
>> By storing the ticket in the user's configuration directory, it can be
>> reused later if the user logs out.
>
> Hmm, but XDG_CONFIG_HOME does not have to point to ~/.config, so is
> this really solving the problem?

The xdg crate will error out if XDG_RUNTIME_DIR is not set, however it
will fall back to ~/.config if the XDG_CONFIG_HOME env variable is not
set. That is the key difference.

> Would it maybe be nicer to keep the default in XDG_RUNTIME_DIR and
> fallback to some other mechanism, like kernel keyring or alternatively
> maybe systemd creds?

That could be done. In v1 I proposed simply using `/run/proxmox-backup`
(or /run/user/$uid/proxmox-backup), but a different mechanism could be
used.

Regarding kernel keyring or systemd creds, at least the later requires
root access as of debian 12. An issue common to these three mechanisms
is that they all make assumptions about permissions, the backup client
could be run as an arbitrary user which might not have permissions to
any of /run, the keyring, nor the system credentials.

> The [keyrings manpage] description would make it seem like an ideal
> candidate for such things:
>
> "The Linux key-management facility is primarily a way for various
> kernel components to retain or cache security data, authentication
> keys, encryption keys, and other data in the kernel."
>
> I.e., the ticket _is_ security data and an authentication key that
> needs to be cached. One can even set an expiry time for such keys.
>
>
> [keyrings manpage]: https://manpages.debian.org/bookworm/manpages/keyrings.7.en.html
>
>> Since the tickets are only valid for a limited time, it is not a problem
>> if this file is not automatically cleaned.
>
> But that's also why it certainly isn't a config, so feels IMO also
> wrong besides above point about this being rather a lateral move.

I think this was a massive mental lapsus on my end, this should have
been ~/.cache and definitively not ~/.config.


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


  reply	other threads:[~2025-04-18 12:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16 12:56 Maximiliano Sandoval
2025-04-16 12:56 ` [pbs-devel] [PATCH backup v3 2/2] http_client: add warning when we fail to place a config file Maximiliano Sandoval
2025-04-18 12:46 ` [pbs-devel] [PATCH backup v3 1/2] http_client: store tickets in the user's config directory Thomas Lamprecht
2025-04-18 12:47   ` Maximiliano Sandoval [this message]
2025-04-18 13:14     ` Thomas Lamprecht
2025-04-18 13:20       ` Maximiliano Sandoval

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=s8ott6liq4q.fsf@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=t.lamprecht@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