prune: fix workerid issues

properly encode the namespace as separate field both for manual prunes
and the job. fix the access checks as well now that the job doesn't use
the jobid as workerid anymore.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler authored and Thomas Lamprecht committed 2022-05-16 18:49:19 +02:00
1 parent e13303fca6
commit 3697161800
3 files changed
+20 -18

No files matched your search

+4 -1
View File
@@ -104,14 +104,17 @@ pub fn do_prune_job(
let worker_type = job.jobtype().to_string();
let auth_id = auth_id.clone();
let worker_id = format!("{store}");
let upid_str = WorkerTask::new_thread(
&worker_type,
Some(job.jobname().to_string()),
Some(worker_id),
auth_id.to_string(),
false,
move |worker| {
job.start(&worker.upid().to_string())?;
task_log!(worker, "prune job '{}'", job.jobname());
if let Some(event_str) = schedule {
task_log!(worker, "task triggered by schedule '{}'", event_str);
}