From 662815ca9789fcfb809cc987a73ee1996e75c6c5 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 16 Jul 2007 12:54:42 +0000 Subject: [PATCH] kes When applying a storage override, release all previous storage definitions rather than just prepending the new storage. This should prevent a good deal of confusion. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5186 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/job.c | 12 +++++++++--- bacula/src/dird/ua_cmds.c | 2 +- bacula/technotes-2.1 | 6 ++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index e2ba3ba2b7..70be904b25 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -976,7 +976,7 @@ void copy_rwstorage(JCR *jcr, alist *storage, const char *where) } -/* Set storage override */ +/* Set storage override. Releases any previous storage definition */ void set_rwstorage(JCR *jcr, USTORE *store) { if (!store) { @@ -1026,7 +1026,7 @@ void copy_rstorage(JCR *jcr, alist *storage, const char *where) } -/* Set storage override */ +/* Set storage override. Remove all previous storage */ void set_rstorage(JCR *jcr, USTORE *store) { STORE *storage; @@ -1034,6 +1034,9 @@ void set_rstorage(JCR *jcr, USTORE *store) if (!store->store) { return; } + if (jcr->rstorage) { + free_rstorage(jcr); + } if (!jcr->rstorage) { jcr->rstorage = New(alist(10, not_owned_by_alist)); } @@ -1087,7 +1090,7 @@ void copy_wstorage(JCR *jcr, alist *storage, const char *where) } -/* Set storage override */ +/* Set storage override. Remove all previous storage */ void set_wstorage(JCR *jcr, USTORE *store) { STORE *storage; @@ -1095,6 +1098,9 @@ void set_wstorage(JCR *jcr, USTORE *store) if (!store->store) { return; } + if (jcr->wstorage) { + free_wstorage(jcr); + } if (!jcr->wstorage) { jcr->wstorage = New(alist(10, not_owned_by_alist)); } diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 1b97b952fa..4c402fece0 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -1424,10 +1424,10 @@ static void do_mount_cmd(UAContext *ua, const char *command) Dmsg2(120, "%s: %s\n", command, ua->UA_sock->msg); store.store = get_storage_resource(ua, true/*arg is storage*/); - pm_strcpy(store.store_source, _("unknown source")); if (!store.store) { return; } + pm_strcpy(store.store_source, _("unknown source")); set_wstorage(jcr, &store); drive = get_storage_drive(ua, store.store); if (strcmp(command, "mount") == 0) { diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index e36078974b..d5c17e5134 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,12 @@ Technical notes on version 2.1 General: +16Jul07 +kes When applying a storage override, release all previous storage + definitions rather than just prepending the new storage. + This should prevent a good deal of confusion. +14Jul07 +kes Implement ./configure search for qwt libraries. 13Jul07 kes Disable posting the WM_CLOSE message in KillRunningCopy of the Win32 FD. This should fix bug #893. -- 2.39.5