]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Check ClientACL in acl_access_jobid_ok()
authorEric Bollengier <eric@baculasystems.com>
Tue, 28 Mar 2023 13:09:02 +0000 (15:09 +0200)
committerEric Bollengier <eric@baculasystems.com>
Tue, 2 May 2023 07:07:18 +0000 (09:07 +0200)
bacula/src/dird/ua_output.c

index 0001eed2f0fec229625d8bee32dd7222f11a1007..aeaff3c02ed51aeaab53b94ace265b6ccae33a2a 100644 (file)
@@ -286,14 +286,21 @@ bool acl_access_jobid_ok(UAContext *ua, const char *jobids)
       jr.JobId = jid;
 
       if (db_get_job_record(ua->jcr, ua->db, &jr)) {
+         ret = false;
          for (int i=0; i<list->size(); i++) {
             if (strcasecmp(jr.Name, (char *)list->get(i)) == 0) {
                Dmsg3(1400, "ACL found %s in %d %s\n", jr.Name,
                      Job_ACL, (char *)list->get(i));
                ret = true;
-               goto bail_out;
+               break;
             }
          }
+         if (ret && !acl_access_client_ok(ua, jr.Client, JT_BACKUP)) {
+            ret = false;
+         }
+      }
+      if (!ret) {
+         goto bail_out;
       }
    }