all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: [pbs-devel] applied: [PATCH proxmox-backup] fix: api2: make tasks endpoint work with new prune job worker type
Date: Thu, 14 Jul 2022 14:46:04 +0200	[thread overview]
Message-ID: <1657802040.d358x68txc.astroid@nora.none> (raw)
In-Reply-To: <20220713143629.459837-1-s.sterz@proxmox.com>

thanks!

On July 13, 2022 4:36 pm, Stefan Sterz wrote:
> when prune jobs were refactored, their worker type was changed from
> "prune" to "prunejob" this broke `check_job_store` and
> `check_job_privs`
> 
> as reported in the forum: https://forum.proxmox.com/threads/problem-with-apirequest-on-pbs-2-2-3.112131/#post-483835
> 
> Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
> ---
> afaict: we can't just remove the "prune" branches here, because there
> are tasks that will still use this worker id. e.g. prune tasks created
> by the `POST /api2/json/admin/datastore/{store}/prune-datastore` 
> endpoint
> 
>  src/api2/node/tasks.rs | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/api2/node/tasks.rs b/src/api2/node/tasks.rs
> index 592e927d..cbd0894e 100644
> --- a/src/api2/node/tasks.rs
> +++ b/src/api2/node/tasks.rs
> @@ -64,7 +64,7 @@ fn check_job_privs(auth_id: &Authid, user_info: &CachedUserInfo, upid: &UPID) ->
>                  true,
>              )
>          }
> -        ("prune", Some(workerid)) => {
> +        ("prune", Some(workerid)) | ("prunejob", Some(workerid)) => {
>              let mut acl_path = vec!["datastore"];
>              acl_path.extend(workerid.split(':'));
>              let acl_path = match acl_path.len() {
> @@ -103,6 +103,7 @@ fn check_job_store(upid: &UPID, store: &str) -> bool {
>              }
>          }
>          ("prune", Some(workerid))
> +        | ("prunejob", Some(workerid))
>          | ("backup", Some(workerid))
>          | ("garbage_collection", Some(workerid)) => {
>              return workerid == store || workerid.starts_with(&format!("{}:", store));
> -- 
> 2.30.2
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> 
> 
> 




      reply	other threads:[~2022-07-14 12:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 14:36 [pbs-devel] " Stefan Sterz
2022-07-14 12:46 ` Fabian Grünbichler [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=1657802040.d358x68txc.astroid@nora.none \
    --to=f.gruenbichler@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 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