From 65a5e7586eaf3968c543174ac457a16139e77b3d Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 8 Jun 2007 09:30:38 +0000 Subject: [PATCH] Fix update allfrompool to pass pool name. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4999 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/ua_update.c | 15 +++++++++++---- bacula/src/version.h | 6 +++--- bacula/technotes-2.1 | 2 ++ 3 files changed, 16 insertions(+), 7 deletions(-) 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 -- 2.39.5