Skip to content

Commit

Permalink
Don't show unauthorized schedules/jobs in status scheduler.
Browse files Browse the repository at this point in the history
Fixes #290: Error in bconsole-ACL
  • Loading branch information
Marco van Wieringen committed Feb 17, 2015
1 parent bc5681b commit 696b6cd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/dird/ua_status.c
Expand Up @@ -640,6 +640,10 @@ static void do_scheduler_status(UAContext *ua)
foreach_res(sched, R_SCHEDULE) {
int cnt = 0;

if (!acl_access_ok(ua, Schedule_ACL, sched->hdr.name)) {
continue;
}

if (schedulegiven) {
if (!bstrcmp(sched->hdr.name, schedulename)) {
continue;
Expand All @@ -655,6 +659,10 @@ static void do_scheduler_status(UAContext *ua)
}
} else {
foreach_res(job, R_JOB) {
if (!acl_access_ok(ua, Job_ACL, job->hdr.name)) {
continue;
}

if (client && job->client != client) {
continue;
}
Expand Down Expand Up @@ -709,6 +717,10 @@ static void do_scheduler_status(UAContext *ua)
} else {
LockRes();
foreach_res(job, R_JOB) {
if (!acl_access_ok(ua, Job_ACL, job->hdr.name)) {
continue;
}

if (job->schedule && job->client == client) {
if (!show_scheduled_preview(ua, job->schedule, overview,
&max_date_len, tm, time_to_check)) {
Expand All @@ -727,6 +739,10 @@ static void do_scheduler_status(UAContext *ua)
*/
LockRes();
foreach_res(sched, R_SCHEDULE) {
if (!acl_access_ok(ua, Schedule_ACL, sched->hdr.name)) {
continue;
}

if (schedulegiven) {
if (!bstrcmp(sched->hdr.name, schedulename)) {
continue;
Expand Down

0 comments on commit 696b6cd

Please sign in to comment.