]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/ua_update.c
Tweak restore path prompt
[bacula/bacula] / bacula / src / dird / ua_update.c
index 7728baf01c9120e17b599b8bcbb01ca1e1c8ff00..7433147cbbfaf00e544e949a188a9e8d4c739468 100644 (file)
@@ -1,12 +1,12 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2012 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -299,6 +299,7 @@ static void update_volslot(UAContext *ua, char *val, MEDIA_DBR *mr)
     * Make sure to use db_update... rather than doing this directly,
     *   so that any Slot is handled correctly.
     */
+   set_storageid_in_mr(NULL, mr);
    if (!db_update_media_record(ua->jcr, ua->db, mr)) {
       ua->error_msg(_("Error updating media record Slot: ERR=%s"), db_strerror(ua->db));
    } else {
@@ -407,7 +408,6 @@ static void update_all_vols_from_pool(UAContext *ua, const char *pool_name)
    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)) {
@@ -431,7 +431,6 @@ static void update_all_vols(UAContext *ua)
    MEDIA_DBR mr;
 
    memset(&pr, 0, sizeof(pr));
-   memset(&mr, 0, sizeof(mr));
    
    if (!db_get_pool_ids(ua->jcr, ua->db, &num_pools, &ids)) {
       ua->error_msg(_("Error obtaining pool ids. ERR=%s\n"), db_strerror(ua->db));
@@ -465,6 +464,7 @@ static void update_volenabled(UAContext *ua, char *val, MEDIA_DBR *mr)
    if (mr->Enabled < 0) {
       return;
    }
+   set_storageid_in_mr(NULL, mr);
    if (!db_update_media_record(ua->jcr, ua->db, mr)) {
       ua->error_msg(_("Error updating media record Enabled: ERR=%s"),
                     db_strerror(ua->db));
@@ -482,6 +482,7 @@ static void update_vol_actiononpurge(UAContext *ua, char *val, MEDIA_DBR *mr)
       mr->ActionOnPurge = 0;
    }
    
+   set_storageid_in_mr(NULL, mr);
    if (!db_update_media_record(ua->jcr, ua->db, mr)) {
       ua->error_msg(_("Error updating media record ActionOnPurge: ERR=%s"),
                     db_strerror(ua->db));
@@ -722,6 +723,7 @@ static int update_volume(UAContext *ua)
           * Make sure to use db_update... rather than doing this directly,
           *   so that any Slot is handled correctly.
           */
+         set_storageid_in_mr(NULL, &mr);
          if (!db_update_media_record(ua->jcr, ua->db, &mr)) {
             ua->error_msg(_("Error updating media record Slot: ERR=%s"), db_strerror(ua->db));
          } else {