From: Kern Sibbald Date: Fri, 8 Jun 2007 09:30:38 +0000 (+0000) Subject: Fix update allfrompool to pass pool name. X-Git-Tag: Release-2.2.0~296 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0a572112e8cfd9f066e69c12764a2131764d34a2;p=bacula%2Fbacula Fix update allfrompool to pass pool name. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4999 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/ua_update.c b/bacula/src/dird/ua_update.c index 7a33e4b0de..4bbd113c59 100644 --- a/bacula/src/dird/ua_update.c +++ b/bacula/src/dird/ua_update.c @@ -386,13 +386,15 @@ static void update_vol_from_pool(UAContext *ua, MEDIA_DBR *mr) * Refresh the Volume information from the Pool record * for all Volumes */ -static void update_all_vols_from_pool(UAContext *ua) +static void update_all_vols_from_pool(UAContext *ua, const char *pool_name) { POOL_DBR pr; MEDIA_DBR mr; memset(&pr, 0, sizeof(pr)); memset(&mr, 0, sizeof(mr)); + + bstrncpy(pr.Name, pool_name, sizeof(pr.Name)); if (!get_pool_dbr(ua, &pr)) { return; } @@ -401,7 +403,8 @@ static void update_all_vols_from_pool(UAContext *ua) 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 Pool record.\n")); + ua->info_msg(_("All Volume defaults updated from \"%s\" Pool record.\n"), + pr.Name); } } @@ -429,6 +432,7 @@ static void update_volenabled(UAContext *ua, char *val, MEDIA_DBR *mr) static int update_volume(UAContext *ua) { MEDIA_DBR mr; + POOL *pool; POOL_DBR pr; POOLMEM *query; char ed1[130]; @@ -502,7 +506,7 @@ static int update_volume(UAContext *ua) update_vol_from_pool(ua, &mr); return 1; case 11: - update_all_vols_from_pool(ua); + update_all_vols_from_pool(ua, ua->argv[j]); return 1; case 12: update_volenabled(ua, ua->argv[j], &mr); @@ -684,7 +688,10 @@ static int update_volume(UAContext *ua) update_vol_from_pool(ua, &mr); return 1; case 12: - update_all_vols_from_pool(ua); + pool = select_pool_resource(ua); + if (pool) { + update_all_vols_from_pool(ua, pool->name()); + } return 1; case 13: diff --git a/bacula/src/version.h b/bacula/src/version.h index f980cba716..ed23507a82 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -3,9 +3,9 @@ */ #undef VERSION -#define VERSION "2.1.12" -#define BDATE "04 June 2007" -#define LSMDATE "04Jun07" +#define VERSION "2.1.13" +#define BDATE "08 June 2007" +#define LSMDATE "08Jun07" #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n" #define BYEAR "2007" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 5f8e2518c3..f1d05ff2d8 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,8 @@ Technical notes on version 2.1 General: +08Jun07 +kes Fix update allfrompool to pass pool name. 07Jun07 kes Convert to pure GPL v2 license. kes Fix sscanf problems reported by Peter Buschman that caused