diff --git a/src/dird/ua_update.c b/src/dird/ua_update.c index c838360eef6..cba0aa58feb 100644 --- a/src/dird/ua_update.c +++ b/src/dird/ua_update.c @@ -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) { @@ -441,19 +440,25 @@ static void update_all_vols(UAContext *ua) for (i = 0; ijcr, 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); } }