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.
  • Loading branch information
Marco van Wieringen authored and pstorz committed Mar 27, 2015
1 parent e1c406d commit 89db075
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/dird/ua_update.c
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 89db075

Please sign in to comment.