]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Check client ACL on purge jobid=x
authorEric Bollengier <eric@baculasystems.com>
Wed, 22 Mar 2023 13:54:53 +0000 (14:54 +0100)
committerEric Bollengier <eric@baculasystems.com>
Tue, 2 May 2023 07:07:18 +0000 (09:07 +0200)
bacula/src/dird/ua_purge.c

index 6c96ba9624a460b057bc67767004a9e1075133f5..f23c14040f5425613b038406767a3e89340a2e69 100644 (file)
@@ -105,10 +105,14 @@ int purge_cmd(UAContext *ua, const char *cmd)
       case 0:                         /* Job */
       case 1:                         /* JobId */
          if (get_job_dbr(ua, &jr)) {
-            if (acl_access_ok(ua, Job_ACL, jr.Name)) {
+            if (acl_access_ok(ua, Job_ACL, jr.Name) &&
+                acl_access_ok(ua, Client_ACL, jr.Client))
+            {
                char jobid[50];
                edit_int64(jr.JobId, jobid);
                purge_files_from_jobs(ua, jobid);
+            } else {
+               ua->error_msg(_("Invalid jobid\n"));
             }
          }
          return 1;