]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Rename Protect to Protected
authorEric Bollengier <eric@baculasystems.com>
Fri, 4 Nov 2022 10:25:30 +0000 (11:25 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:00 +0000 (13:57 +0200)
20 files changed:
bacula/src/cats/cats.h
bacula/src/cats/make_mysql_tables.in
bacula/src/cats/make_postgresql_tables.in
bacula/src/cats/make_sqlite3_tables.in
bacula/src/cats/sql_create.c
bacula/src/cats/sql_get.c
bacula/src/cats/sql_list.c
bacula/src/cats/sql_update.c
bacula/src/cats/update_mysql_tables.in
bacula/src/cats/update_postgresql_tables.in
bacula/src/dird/catreq.c
bacula/src/dird/next_vol.c
bacula/src/dird/ua_cmds.c
bacula/src/dird/ua_purge.c
bacula/src/dird/ua_update.c
bacula/src/stored/askdir.c
bacula/src/stored/block_util.c
bacula/src/stored/dev.h
bacula/updatedb/update_mysql_tables_1025_to_1026.in
bacula/updatedb/update_postgresql_tables_1025_to_1026.in

index e88b755e14b425b16cb98dca6bbcdd818bd259a8..2bdbfcff4045b4fca45a22d0eb0c83bede538bf4 100644 (file)
@@ -401,7 +401,7 @@ public:
    DBId_t StorageId;
    char Name[MAX_NAME_LENGTH];        /* Device name */
    int AutoChanger;                   /* Set if autochanger */
-   int UseProtect;                    /* Set if the Storage Daemon can handle Protect */
+   int UseProtect;                    /* Set if the Storage Daemon can handle Protected */
 
    /* Not in database */
    bool created;                      /* set if created by db_create ... */
@@ -458,8 +458,8 @@ public:
    uint32_t MaxVolJobs;               /* Max Jobs on Volume */
    uint32_t MaxVolFiles;              /* Max files on Volume */
    int32_t  Recycle;                  /* recycle yes/no */
-   int32_t  Protect;                  /* Protect yes/no */
-   int32_t  UseProtect;               /* Use Protect feature yes/no */
+   int32_t  Protected;                  /* Protected yes/no */
+   int32_t  UseProtect;               /* Use Protected feature yes/no */
    int32_t  Slot;                     /* slot in changer */
    int32_t  Enabled;                  /* 0=disabled, 1=enabled, 2=archived */
    int32_t  InChanger;                /* Volume currently in changer */
index 175f9a3bf0d45a247c4579eda5e57fe896611c77..d54c04ad99697c536e70bc1c43d9c380378d70a1 100644 (file)
@@ -479,7 +479,7 @@ CREATE TABLE Media (
    ScratchPoolId INTEGER UNSIGNED DEFAULT 0,
    RecyclePoolId INTEGER UNSIGNED DEFAULT 0,
    Comment BLOB,
-   Protect TINYINT DEFAULT 0,
+   Protected TINYINT DEFAULT 0,
    UseProtect TINYINT DEFAULT 0,
    PRIMARY KEY(MediaId),
    UNIQUE (VolumeName(128)),
index e2a9005e8c545137294883274b8cdc13738ac25c..ac26f447993a20faa7fbdaa40a8ab425c4016f4e 100644 (file)
@@ -418,7 +418,7 @@ CREATE TABLE media
     scratchpoolid     integer    default 0,
     recyclepoolid     integer    default 0,
     comment          text,
-    protect           smallint    default 0,
+    protected         smallint    default 0,
     useprotect        smallint    default 0,
     primary key (mediaid)
 );
index 34b97947f5eb2ab956bae593bf707fa05b7085bd..8962799f7890f536cc474340e4ea2d7a86b954a8 100644 (file)
@@ -425,7 +425,7 @@ CREATE TABLE Media (
    ScratchPoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
    RecyclePoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0,
    Comment TEXT,
-   Protect TINYINT DEFAULT 0,
+   Protected TINYINT DEFAULT 0,
    UseProtect TINYINT DEFAULT 0,
    PRIMARY KEY(MediaId)
    );
index 9b9467872ebcba3b6c6b2eba662745a3380d1527..f0d32219f258672eecb44e62bbb5ad4d073b80b8 100644 (file)
@@ -442,9 +442,9 @@ int BDB::bdb_create_media_record(JCR *jcr, MEDIA_DBR *mr)
 "VolStatus,Slot,VolBytes,InChanger,VolReadTime,VolWriteTime,VolType,"
 "VolParts,VolCloudParts,LastPartBytes,"
 "EndFile,EndBlock,LabelType,StorageId,DeviceId,LocationId,"
-"ScratchPoolId,RecyclePoolId,Enabled,ActionOnPurge,CacheRetention,UseProtect,Protect)"
+"ScratchPoolId,RecyclePoolId,Enabled,ActionOnPurge,CacheRetention,UseProtect,Protected)"
 "VALUES ('%s','%s',0,%lu,%s,%s,%ld,%s,%s,%lu,%lu,'%s',%ld,%s,%ld,%s,%s,%ld,"
-        "%ld,%ld,'%s',%ld,%ld,%ld,%s,%s,%s,%s,%s,%ld,%ld,%s,%ld)",
+        "%ld,%ld,'%s',%ld,%ld,%ld,%s,%s,%s,%s,%s,%ld,%ld,%s,%ld,%ld)",
           esc_name,
           esc_mtype, mr->PoolId,
           edit_uint64(mr->MaxVolBytes,ed1),
@@ -476,7 +476,7 @@ int BDB::bdb_create_media_record(JCR *jcr, MEDIA_DBR *mr)
           mr->ActionOnPurge,
           edit_uint64(mr->CacheRetention, ed14),
           mr->UseProtect,
-          mr->Protect
+          mr->Protected
           );
 
 
index 998452d7c17abf26770116ccec77264fb12a168f..2380ae6ab80c5977c189e855f9cf0632f83de5f8 100644 (file)
@@ -1370,7 +1370,7 @@ bool BDB::bdb_get_media_record(JCR *jcr, MEDIA_DBR *mr)
          "EndFile,EndBlock,VolType,VolParts,VolCloudParts,LastPartBytes,"
          "LabelType,LabelDate,StorageId,"
          "Enabled,LocationId,RecycleCount,InitialWrite,"
-         "ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,ActionOnPurge,CacheRetention,Pool.Name,Protect,UseProtect "
+         "ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,ActionOnPurge,CacheRetention,Pool.Name,Protected,UseProtect "
          "FROM Media JOIN Pool USING (PoolId) WHERE MediaId=%s",
          edit_int64(mr->MediaId, ed1));
    } else {                           /* find by name */
@@ -1383,7 +1383,7 @@ bool BDB::bdb_get_media_record(JCR *jcr, MEDIA_DBR *mr)
          "EndFile,EndBlock,VolType,VolParts,VolCloudParts,LastPartBytes,"
          "LabelType,LabelDate,StorageId,"
          "Enabled,LocationId,RecycleCount,InitialWrite,"
-         "ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,ActionOnPurge,CacheRetention,Pool.Name,Protect,UseProtect "
+         "ScratchPoolId,RecyclePoolId,VolReadTime,VolWriteTime,ActionOnPurge,CacheRetention,Pool.Name,Protected,UseProtect "
          "FROM Media JOIN Pool USING (PoolId) WHERE VolumeName='%s'", esc);
    }
 
@@ -1449,8 +1449,9 @@ bool BDB::bdb_get_media_record(JCR *jcr, MEDIA_DBR *mr)
             mr->ActionOnPurge = str_to_int32(row[43]);
             mr->CacheRetention = str_to_int64(row[44]);
             bstrncpy(mr->Pool, row[45], sizeof(mr->Pool));
-            mr->Protect = str_to_int64(row[46]);
-            mr->UseProtect = str_to_int64(row[47]);
+            mr->Protected = str_to_int64(row[45]);
+            mr->UseProtect = str_to_int64(row[46]);
+
             ok = true;
          }
       } else {
index de61189e4067c79577d5623d0ec132cfb52581b0..552d046ef9111eeac7cf4eb7788795a4076bb75d 100644 (file)
@@ -490,7 +490,7 @@ void BDB::bdb_list_media_records(JCR *jcr, MEDIA_DBR *mdbr,
             "EndFile,EndBlock,VolType,Media.LabelType,StorageId,DeviceId,"
             "MediaAddressing,VolReadTime,VolWriteTime,"
             "LocationId,RecycleCount,InitialWrite,Media.ScratchPoolId,Media.RecyclePoolId, "
-            "Media.ActionOnPurge,%s AS ExpiresIn, Comment, Protect, UseProtect"
+            "Media.ActionOnPurge,%s AS ExpiresIn, Comment, Protected, UseProtect"
            " FROM Media %s WHERE Media.VolumeName='%s' %s",
               expiresin,
               join,
@@ -508,7 +508,7 @@ void BDB::bdb_list_media_records(JCR *jcr, MEDIA_DBR *mdbr,
             "EndFile,EndBlock,VolType,Media.LabelType,StorageId,DeviceId,"
             "MediaAddressing,VolReadTime,VolWriteTime,"
             "LocationId,RecycleCount,InitialWrite,Media.ScratchPoolId,Media.RecyclePoolId, "
-            "Media.ActionOnPurge,%s AS ExpiresIn, Comment, Protect, UseProtect"
+            "Media.ActionOnPurge,%s AS ExpiresIn, Comment, Protected, UseProtect"
             " FROM Media %s WHERE Media.PoolId=%s %s ORDER BY MediaId",
               expiresin,
               join,
index f367cd3886f055c4ae2ac42b61b86bb576a9b550..2ec63537cfc473d5d11cc0890aca5cbfb4fcb307 100644 (file)
@@ -408,7 +408,7 @@ int BDB::bdb_update_media_record(JCR *jcr, MEDIA_DBR *mr)
         "LabelType=%d,StorageId=%s,PoolId=%s,VolRetention=%s,VolUseDuration=%s,"
         "MaxVolJobs=%d,MaxVolFiles=%d,Enabled=%d,LocationId=%s,"
         "ScratchPoolId=%s,RecyclePoolId=%s,RecycleCount=%d,Recycle=%d,"
-        "ActionOnPurge=%d,CacheRetention=%s,EndBlock=%u,Protect=%d,UseProtect=%d"
+        "ActionOnPurge=%d,CacheRetention=%s,EndBlock=%u,Protected=%d,UseProtect=%d"
         " WHERE VolumeName='%s'",
         mr->VolJobs, mr->VolFiles, mr->VolBlocks,
         edit_uint64(mr->VolBytes, ed1),
@@ -435,7 +435,7 @@ int BDB::bdb_update_media_record(JCR *jcr, MEDIA_DBR *mr)
         edit_uint64(mr->RecyclePoolId, ed15),
         mr->RecycleCount,mr->Recycle, mr->ActionOnPurge,
         edit_uint64(mr->CacheRetention, ed16),
-        mr->EndBlock,mr->Protect,mr->UseProtect,
+        mr->EndBlock,mr->Protected,mr->UseProtect,
         esc_name);
 
    Dmsg1(dbglevel1, "%s\n", cmd);
index c0b893616dcd67a5e3f78afc580fc316f2f9b118..c166d5a14191ab9289b481216cb7ac0219fe4e88 100644 (file)
@@ -706,7 +706,7 @@ CREATE INDEX meta_attachmentowner ON MetaAttachment (AttachmentTenant(255),Attac
 CREATE INDEX meta_attachmentemailid ON MetaAttachment (AttachmentEmailId(255));
 
 ALTER TABLE Media
-    MODIFY COLUMN Protect TINYINT DEFAULT 0,
+    MODIFY COLUMN Protected TINYINT DEFAULT 0,
     MODIFY COLUMN UseProtect TINYINT DEFAULT 0;
 
 ALTER TABLE Object
@@ -728,10 +728,6 @@ ALTER TABLE Job
     ADD COLUMN WriteDevice       blob,
     ADD COLUMN Encrypted         int        default 0;
 
-ALTER TABLE Media
-    ADD COLUMN Protect     smallint default 0,
-    ADD COLUMN UseProtect  smallint default 0;
-
 INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
   ('DU0001', 'catalog_update', NOW(), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1026');
 UPDATE Version SET VersionId=1026;
index 9376d86dde127774b1d067d4dfcfcc540c0f2912..4e71cd1f8373ca2b3b2f5ff22a99040cf92cdec5 100644 (file)
@@ -758,7 +758,7 @@ ALTER TABLE Job ADD COLUMN WriteDevice       text        default ''
 ALTER TABLE Job ADD COLUMN StatusInfo        text        default '';
 ATLER TABLE Job ADD COLUMN Encrypted         int         default 0;
 
-ALTER TABLE Media ADD COLUMN Protect              smallint    default 0;
+ALTER TABLE Media ADD COLUMN Protected              smallint    default 0;
 ALTER TABLE Media ADD COLUMN IsProtect            smallint    default 0;
 
 INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
index acf2f9801a5dc7ef575888836cf6a40c2e7755fc..8d54068a70bd9386112abb8e7444fc430d62da1e 100644 (file)
@@ -47,7 +47,7 @@ static char Update_media[] = "CatReq JobId=%ld UpdateMedia VolName=%s"
    " VolErrors=%u VolWrites=%lld MaxVolBytes=%lld EndTime=%lld VolStatus=%10s"
    " Slot=%d relabel=%d InChanger=%d VolReadTime=%llu VolWriteTime=%llu"
    " VolFirstWritten=%lld VolType=%u VolParts=%d VolCloudParts=%d"
-   " LastPartBytes=%lld Enabled=%d Recycle=%d Protect=%d UseProtect=%d\n";
+   " LastPartBytes=%lld Enabled=%d Recycle=%d Protected=%d UseProtect=%d\n";
 
 static char FileEvent_add[] = "%c %d %127s %127s 0";
 /* Full format when coming from the Verify Job */
@@ -67,7 +67,7 @@ static char OK_media[] = "1000 OK VolName=%s VolJobs=%u VolFiles=%u"
    " MaxVolJobs=%u MaxVolFiles=%u InChanger=%d VolReadTime=%s"
    " VolWriteTime=%s EndFile=%u EndBlock=%u VolType=%u LabelType=%d"
    " MediaId=%s ScratchPoolId=%s VolParts=%d VolCloudParts=%d"
-   " LastPartBytes=%lld Enabled=%d MaxPoolBytes=%s PoolBytes=%s Recycle=%d Protect=%d UseProtect=%d\n";
+   " LastPartBytes=%lld Enabled=%d MaxPoolBytes=%s PoolBytes=%s Recycle=%d Protected=%d UseProtect=%d\n";
 
 static char OK_create[] = "1000 OK CreateJobMedia\n";
 
@@ -120,7 +120,7 @@ static int send_volume_info_to_storage_daemon(JCR *jcr, BSOCK *sd, MEDIA_DBR *mr
       mr->Enabled,
       edit_uint64(pr.MaxPoolBytes, ed11),
       edit_uint64(pr.PoolBytes, ed12),
-      mr->Recycle, mr->Protect, mr->UseProtect);
+      mr->Recycle, mr->Protected, mr->UseProtect);
    unbash_spaces(mr->VolumeName);
    Dmsg2(100, "Vol Info for %s: %s", jcr->Job, sd->msg);
    return stat;
@@ -188,7 +188,7 @@ void catalog_request(JCR *jcr, BSOCK *bs)
    utime_t VolLastWritten;
    int n;
    int can_create=0, use_protect=0;
-   int Enabled, Recycle, Protect, UseProtect;
+   int Enabled, Recycle, Protected, UseProtect;
    JobId_t JobId = 0;
    STORE *wstore = jcr->store_mngr->get_wstore();
 
@@ -316,7 +316,7 @@ void catalog_request(JCR *jcr, BSOCK *bs)
       &VolLastWritten, &sdmr.VolStatus, &sdmr.Slot, &label, &sdmr.InChanger,
       &sdmr.VolReadTime, &sdmr.VolWriteTime, &VolFirstWritten,
       &sdmr.VolType, &sdmr.VolParts, &sdmr.VolCloudParts,
-      &sdmr.LastPartBytes, &Enabled, &Recycle, &Protect, &UseProtect);
+      &sdmr.LastPartBytes, &Enabled, &Recycle, &Protected, &UseProtect);
     if (n == 29) {
       db_lock(jcr->db);
       Dmsg3(400, "Update media %s oldStat=%s newStat=%s\n", sdmr.VolumeName,
@@ -403,7 +403,7 @@ void catalog_request(JCR *jcr, BSOCK *bs)
       mr.LastPartBytes = sdmr.LastPartBytes;
       mr.Enabled       = Enabled;  /* byte assignment */
       mr.Recycle       = Recycle;  /* byte assignment */
-      mr.Protect          = Protect;    /* byte assignment */
+      mr.Protected          = Protected;    /* byte assignment */
       mr.UseProtect       = UseProtect;  /* byte assignment */
       bstrncpy(mr.VolStatus, sdmr.VolStatus, sizeof(mr.VolStatus));
       mr.VolReadTime  = sdmr.VolReadTime;
index d60df3c80a56eaf18dda88eb7ff6c6c4012be152..2762a2945c32db92f1aea5da0ebccaa30f090aff 100644 (file)
@@ -229,7 +229,7 @@ int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, int index,
       }
       Dmsg2(dbglvl, "VolJobs=%d FirstWritten=%d\n", mr->VolJobs, mr->FirstWritten);
       if (ok) {
-         /* If the current device uses the Protect feature, we need to keep track of it */
+         /* If the current device uses the Protected feature, we need to keep track of it */
          if (use_protect == 1) {
             mr->UseProtect = 1;
          }
@@ -328,7 +328,7 @@ bool has_volume_expired(JCR *jcr, MEDIA_DBR *mr)
          expired = true;
       }
    }
-   /* Here, if the volume is Protect, we cannot change the status if a storage
+   /* Here, if the volume is Protected, we cannot change the status if a storage
     * is not connected
     */
    if (expired) {
@@ -342,7 +342,7 @@ bool has_volume_expired(JCR *jcr, MEDIA_DBR *mr)
    }
    Dmsg2(dbglvl, "Vol=%s expired=%d\n", mr->VolumeName, expired);
    /* Special case, we have marked the volume as Expired, and the Storage
-    * Daemon wants to mark it as Protect
+    * Daemon wants to mark it as Protected
     */
    if (expired && mr->UseProtect) {
       return false;
index b711efa94f166c91bb774ec5cf3b409cf60c5550..140a31e71482af03e8b91d2ed2939c7a0afb835d 100644 (file)
@@ -2626,7 +2626,7 @@ int cloud_volumes_cmd(UAContext *ua, const char *cmd, const char *mode)
       ua->send_events("DC0014", EVENTS_TYPE_COMMAND,
                       "%s storage=%s volume=%s", action, storage, mr.VolumeName);
 
-      /* Protect us from spaces */
+      /* Protected us from spaces */
       bash_spaces(mr.VolumeName);
       bash_spaces(mr.MediaType);
       bash_spaces(pr.Name);
@@ -2723,7 +2723,7 @@ static int cloud_list_cmd(UAContext *ua, const char *cmd)
       goto bail_out;
    }
 
-   /* Protect us from spaces */
+   /* Protected us from spaces */
    bash_spaces(mr.MediaType);
    bash_spaces(storage);
    bash_spaces(mr.VolumeName);
index 075378c2ce0c10f6a1d574351597a4b2f6353c44..e95e608749d188473b5d64e101a62e59e7994768 100644 (file)
@@ -727,7 +727,7 @@ static void truncate_volume(UAContext *ua, MEDIA_DBR *mr,
     * is disabled for the specific device, this will be a no-op.
     */
 
-   /* Protect us from spaces */
+   /* Protected us from spaces */
    bash_spaces(mr->VolumeName);
    bash_spaces(mr->MediaType);
    bash_spaces(pool);
index 988091defa8fa6b266780508d79aa6d1d80c5001..52c05050771746829bbee600f211ca25ddf76d97 100644 (file)
@@ -1138,7 +1138,7 @@ static int media_protect_list_handler(void *ctx, int num_fields, char **row)
 } 
 
 /*
- * Protect a volume. If the command is executed from RunScript Admin
+ * Protected a volume. If the command is executed from RunScript Admin
  * the return code of the commnand is used to update the status.
  */
 static int update_volumeprotect_cmd(UAContext *ua)
@@ -1196,7 +1196,7 @@ static int update_volumeprotect_cmd(UAContext *ua)
 
    Mmsg(tmp, "SELECT Media.MediaId, Media.MediaType, Media.VolumeName, Storage.Name "
                "FROM Media JOIN Storage USING (StorageId) JOIN Pool USING (PoolId) "
-              "WHERE UseProtect=1 AND Protect=0 AND VolStatus IN ('Used', 'Full') %s "
+              "WHERE UseProtect=1 AND Protected=0 AND VolStatus IN ('Used', 'Full') %s "
            "ORDER BY Storage.Name", filter.c_str());
 
    db_sql_query(ua->db, tmp.c_str(),
@@ -1265,7 +1265,7 @@ static int update_volumeprotect_cmd(UAContext *ua)
          ua->send_events("DC0013", EVENTS_TYPE_COMMAND, "volumeprotect storage=%s dev=%s volume=%s",
                          elt->storage, selected_dev_name, elt->volname);
          ua->send_msg("%s", sd->msg);
-         Mmsg(tmp, "UPDATE Media SET Protect=1 WHERE MediaId=%d", elt->id);
+         Mmsg(tmp, "UPDATE Media SET Protected=1 WHERE MediaId=%d", elt->id);
          db_lock(ua->db);
          if (!db_sql_query(ua->db, tmp.c_str(), NULL, NULL)) {
             ua->error_msg("Unable to update volume record. %s\n", ua->db->errmsg);
index 4aadc4f35d7bc282b1a4a443246ca83fc5b410c7..6312e69035d1553a712d6beaf3febf4e84983587 100644 (file)
@@ -37,7 +37,7 @@ static char Update_media[] = "CatReq JobId=%ld UpdateMedia VolName=%s"
    " VolErrors=%u VolWrites=%u MaxVolBytes=%s EndTime=%s VolStatus=%s"
    " Slot=%d relabel=%d InChanger=%d VolReadTime=%s VolWriteTime=%s"
    " VolFirstWritten=%s VolType=%u VolParts=%d VolCloudParts=%d"
-   " LastPartBytes=%lld Enabled=%d Recycle=%d Protect=%d UseProtect=%d\n";
+   " LastPartBytes=%lld Enabled=%d Recycle=%d Protected=%d UseProtect=%d\n";
 static char Create_jobmedia[] = "CatReq JobId=%ld CreateJobMedia\n";
 static char FileAttributes[] = "UpdCat JobId=%ld FileAttributes ";
 
@@ -51,7 +51,7 @@ static char OK_media[] = "1000 OK VolName=%127s VolJobs=%u VolFiles=%lu"
    " VolReadTime=%lld VolWriteTime=%lld EndFile=%lu EndBlock=%lu"
    " VolType=%lu LabelType=%ld MediaId=%lld ScratchPoolId=%lld"
    " VolParts=%d VolCloudParts=%d LastPartBytes=%lld Enabled=%d MaxPoolBytes=%lld PoolBytes=%lld Recycle=%d"
-   " Protect=%d UseProtect=%d\n";
+   " Protected=%d UseProtect=%d\n";
 
 
 static char OK_create[] = "1000 OK CreateJobMedia\n";
@@ -200,7 +200,7 @@ static bool do_get_volume_info(DCR *dcr)
     BSOCK *dir = jcr->dir_bsock;
     VOLUME_CAT_INFO vol;
     int n;
-    int32_t Enabled, Recycle, Protect, UseProtect;
+    int32_t Enabled, Recycle, Protected, UseProtect;
     int32_t InChanger;
 
     dcr->setVolCatInfo(false);
@@ -222,7 +222,7 @@ static bool do_get_volume_info(DCR *dcr)
                &vol.EndFile, &vol.EndBlock, &vol.VolCatType,
                &vol.LabelType, &vol.VolMediaId, &vol.VolScratchPoolId,
                &vol.VolCatParts, &vol.VolCatCloudParts,
-               &vol.VolLastPartBytes, &Enabled, &vol.MaxPoolBytes, &vol.PoolBytes, &Recycle, &Protect, &UseProtect);
+               &vol.VolLastPartBytes, &Enabled, &vol.MaxPoolBytes, &vol.PoolBytes, &Recycle, &Protected, &UseProtect);
     Dmsg2(dbglvl, "<dird n=%d %s", n, dir->msg);
     if (n != 35) {
        Dmsg1(dbglvl, "get_volume_info failed: ERR=%s", dir->msg);
@@ -238,7 +238,7 @@ static bool do_get_volume_info(DCR *dcr)
     vol.InChanger = InChanger;        /* bool in structure */
     vol.VolEnabled = Enabled;         /* bool in structure */
     vol.VolRecycle = Recycle;         /* bool in structure */
-    vol.Protect = Protect;            /* bool in structure */
+    vol.Protected = Protected;        /* bool in structure */
     vol.UseProtect = UseProtect;      /* bool in structure */
     vol.is_valid = true;
     vol.VolCatBytes = vol.VolCatAmetaBytes + vol.VolCatAdataBytes;
@@ -486,7 +486,7 @@ bool dir_update_volume_info(DCR *dcr, bool label, bool update_LastWritten,
    if (dev->is_worm() && vol.VolRecycle) {
       Jmsg(jcr, M_INFO, 0, _("WORM cassette detected: setting Recycle=No on Volume=\"%s\"\n"), vol.VolCatName);
       vol.VolRecycle = false;
-      vol.Protect = true;
+      vol.Protected = true;
    }
    pm_strcpy(VolumeName, vol.VolCatName);
    bash_spaces(VolumeName);
@@ -525,7 +525,7 @@ bool dir_update_volume_info(DCR *dcr, bool label, bool update_LastWritten,
          vol.VolLastPartBytes,
          Enabled,
          Recycle,
-         vol.Protect,
+         vol.Protected,
          dev->use_protect()
          );
        Dmsg1(100, ">dird %s", dir->msg);
index 75ed089219fe2dc75befb6b151225b655656282f..5fda8b3f2f2372c0e6ba7f754bf70a8ab1f7172d 100644 (file)
@@ -731,7 +731,7 @@ bool is_user_volume_size_reached(DCR *dcr, bool quiet)
             }
             events_send_msg(dcr->jcr, "SJ0003", EVENTS_TYPE_VOLUME, me->hdr.name, (intptr_t)dcr->jcr,
                             "Mark Volume \"%s\" as immutable", dev->getVolCatName());;
-            dev->VolCatInfo.Protect = 1;
+            dev->VolCatInfo.Protected = 1;
          }
       }
 
@@ -752,7 +752,7 @@ bool is_user_volume_size_reached(DCR *dcr, bool quiet)
                Jmsg(dcr->jcr, M_INFO, 0, _("Marking Volume \"%s\" as read-only\n"),
                     dev->getVolCatName());
             }
-            dev->VolCatInfo.Protect = 1;
+            dev->VolCatInfo.Protected = 1;
             events_send_msg(dcr->jcr, "SJ0003", EVENTS_TYPE_VOLUME, me->hdr.name, (intptr_t)dcr->jcr,
                             "Mark Volume \"%s\" as read-only", dev->getVolCatName());;
          }
index 1e4f937e37e5591f90fff8dc93e5de6e4e407e09..c85eb63477374ed52fac27f303b839de67bb980e 100644 (file)
@@ -233,7 +233,7 @@ struct VOLUME_CAT_INFO {
    utime_t  VolFirstWritten;          /* Time of first write */
    utime_t  VolLastWritten;           /* Time of last write */
    bool     InChanger;                /* Set if vol in current magazine */
-   bool     Protect;                  /* Set if the vol is Readonly, worm or immutable */
+   bool     Protected;                /* Set if the vol is Readonly, worm or immutable */
    bool     UseProtect;               /* Set if the device can set the volume Readonly, worm or immutable */
    bool     is_valid;                 /* set if this data is valid */
    bool     VolEnabled;               /* set if volume enabled */
index 605f9e402744c9b1e2dbccb6c9510d63addd4496..f0844621c807fee0936f51afbc0fd2e3830f9f94 100644 (file)
@@ -78,7 +78,7 @@ CREATE INDEX meta_attachmentowner ON MetaAttachment (AttachmentTenant(255),Attac
 CREATE INDEX meta_attachmentemailid ON MetaAttachment (AttachmentEmailId(255));
 
 ALTER TABLE Media
-    MODIFY COLUMN Protect TINYINT DEFAULT 0,
+    MODIFY COLUMN Protected TINYINT DEFAULT 0,
     MODIFY COLUMN UseProtect TINYINT DEFAULT 0;
 
 ALTER TABLE Object
@@ -100,10 +100,6 @@ ALTER TABLE Job
     ADD COLUMN WriteDevice       blob,
     ADD COLUMN Encrypted         int        default 0;
 
-ALTER TABLE Media
-    ADD COLUMN Protect     smallint default 0,
-    ADD COLUMN UseProtect  smallint default 0;
-
 INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
   ('DU0001', 'catalog_update', NOW(), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1026');
 UPDATE Version SET VersionId=1026;
index 35246d233e532a9fb7c90723c6a45ffc812ee413..7861fb89cdcfa67d8406bbdee8d88279ee286ba4 100644 (file)
@@ -65,8 +65,8 @@ ALTER TABLE Job ADD COLUMN WriteDevice       text        default ''
 ALTER TABLE Job ADD COLUMN StatusInfo        text        default '';
 ATLER TABLE Job ADD COLUMN Encrypted         int         default 0;
 
-ALTER TABLE Media ADD COLUMN Protect              smallint    default 0;
-ALTER TABLE Media ADD COLUMN IsProtect            smallint    default 0;
+ALTER TABLE Media ADD COLUMN Protected            smallint    default 0;
+ALTER TABLE Media ADD COLUMN UseProtect           smallint    default 0;
 
 INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
   ('DU0001', 'catalog_update', NOW(), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1026');