Skip to content

Commit

Permalink
Fix FIXME from ages ago.
Browse files Browse the repository at this point in the history
Check ACL for access to pool by ua in update_all_vols_from_pool.

Seems merging some branches removed this commit so applying it again.
  • Loading branch information
Marco van Wieringen committed May 22, 2015
1 parent 84849df commit 43beec0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/dird/ua_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,7 @@ static void update_vol_from_pool(UAContext *ua, MEDIA_DBR *mr)
}

/*
* Refresh the Volume information from the Pool record
* for all Volumes
* Refresh the Volume information from the Pool record for all Volumes
*/
static void update_all_vols_from_pool(UAContext *ua, const char *pool_name)
{
Expand Down Expand Up @@ -441,19 +440,25 @@ static void update_all_vols(UAContext *ua)

for (i = 0; i<num_pools; i++) {
pr.PoolId = ids[i];
if (!db_get_pool_record(ua->jcr, ua->db, &pr)) { /* ***FIXME*** use acl? */
if (!db_get_pool_record(ua->jcr, ua->db, &pr)) {
ua->warning_msg(_("Updating all pools, but skipped PoolId=%d. ERR=%s\n"), db_strerror(ua->db));
continue;
}

/*
* Check access to pool.
*/
if (!acl_access_ok(ua, Pool_ACL, pr.Name, false)) {
continue;
}

set_pool_dbr_defaults_in_media_dbr(&mr, &pr);
mr.PoolId = pr.PoolId;

if (!db_update_media_defaults(ua->jcr, ua->db, &mr)) {
ua->error_msg(_("Error updating Volume records: ERR=%s"), db_strerror(ua->db));
} else {
ua->info_msg(_("All Volume defaults updated from \"%s\" Pool record.\n"),
pr.Name);
ua->info_msg(_("All Volume defaults updated from \"%s\" Pool record.\n"), pr.Name);
}
}

Expand Down

0 comments on commit 43beec0

Please sign in to comment.