public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Shannon Sterz <s.sterz@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox v2 5/7] access: increment user cache generation when saving acl config
Date: Thu, 13 Jun 2024 14:52:34 +0200	[thread overview]
Message-ID: <20240613125236.236802-6-s.sterz@proxmox.com> (raw)
In-Reply-To: <20240613125236.236802-1-s.sterz@proxmox.com>

since `CachedUserInfo` takes care of both, the user config and the acl
config, we need to also bump the cache generation when storing the
acl config.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 proxmox-access-control/src/acl.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/proxmox-access-control/src/acl.rs b/proxmox-access-control/src/acl.rs
index d0449d9a..5ff47e45 100644
--- a/proxmox-access-control/src/acl.rs
+++ b/proxmox-access-control/src/acl.rs
@@ -641,6 +641,9 @@ pub fn save_config(acl: &AclTree) -> Result<(), Error> {
     let conf = acl_config();
     replace_privileged_config(conf, &raw)?;
 
+    // increase cache generation so we reload it next time we access it
+    access_conf().increment_cache_generation()?;
+
     Ok(())
 }
 
-- 
2.39.2



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


  parent reply	other threads:[~2024-06-13 12:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13 12:52 [pbs-devel] [PATCH proxmox v2 0/7] add proxmox-access-control crate Shannon Sterz
2024-06-13 12:52 ` [pbs-devel] [PATCH proxmox v2 1/7] access-control: add the proxmox-access crate to reuse acl trees Shannon Sterz
2024-06-13 12:52 ` [pbs-devel] [PATCH proxmox v2 2/7] access-control: define `User`, `UserWithTokens` and `ApiTokens` types Shannon Sterz
2024-06-13 12:52 ` [pbs-devel] [PATCH proxmox v2 3/7] access-control: make token shadow implementation re-usable Shannon Sterz
2024-06-13 12:52 ` [pbs-devel] [PATCH proxmox v2 4/7] access-control: factor out user config handling Shannon Sterz
2024-06-13 12:52 ` Shannon Sterz [this message]
2024-06-13 12:52 ` [pbs-devel] [PATCH proxmox v2 6/7] access: move to flatten `User` into `UserWithToken` Shannon Sterz
2024-06-13 12:52 ` [pbs-devel] [PATCH proxmox v2 7/7] access-control: split crate in `default` and `impl` features Shannon Sterz
2024-06-19  9:54 ` [pbs-devel] [PATCH proxmox v2 0/7] add proxmox-access-control crate Shannon Sterz

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=20240613125236.236802-6-s.sterz@proxmox.com \
    --to=s.sterz@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