From: Eric Bollengier Date: Fri, 4 Nov 2022 10:25:30 +0000 (+0100) Subject: Rename Protect to Protected X-Git-Tag: Beta-15.0.0~374 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdf15031753226e54d2b00d8d0fedc0c7526b315;p=thirdparty%2Fbacula.git Rename Protect to Protected --- diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index e88b755e1..2bdbfcff4 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -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 */ diff --git a/bacula/src/cats/make_mysql_tables.in b/bacula/src/cats/make_mysql_tables.in index 175f9a3bf..d54c04ad9 100644 --- a/bacula/src/cats/make_mysql_tables.in +++ b/bacula/src/cats/make_mysql_tables.in @@ -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)), diff --git a/bacula/src/cats/make_postgresql_tables.in b/bacula/src/cats/make_postgresql_tables.in index e2a9005e8..ac26f4479 100644 --- a/bacula/src/cats/make_postgresql_tables.in +++ b/bacula/src/cats/make_postgresql_tables.in @@ -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) ); diff --git a/bacula/src/cats/make_sqlite3_tables.in b/bacula/src/cats/make_sqlite3_tables.in index 34b97947f..8962799f7 100644 --- a/bacula/src/cats/make_sqlite3_tables.in +++ b/bacula/src/cats/make_sqlite3_tables.in @@ -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) ); diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index 9b9467872..f0d32219f 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -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 ); diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 998452d7c..2380ae6ab 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -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 { diff --git a/bacula/src/cats/sql_list.c b/bacula/src/cats/sql_list.c index de61189e4..552d046ef 100644 --- a/bacula/src/cats/sql_list.c +++ b/bacula/src/cats/sql_list.c @@ -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, diff --git a/bacula/src/cats/sql_update.c b/bacula/src/cats/sql_update.c index f367cd388..2ec63537c 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -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); diff --git a/bacula/src/cats/update_mysql_tables.in b/bacula/src/cats/update_mysql_tables.in index c0b893616..c166d5a14 100644 --- a/bacula/src/cats/update_mysql_tables.in +++ b/bacula/src/cats/update_mysql_tables.in @@ -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; diff --git a/bacula/src/cats/update_postgresql_tables.in b/bacula/src/cats/update_postgresql_tables.in index 9376d86dd..4e71cd1f8 100644 --- a/bacula/src/cats/update_postgresql_tables.in +++ b/bacula/src/cats/update_postgresql_tables.in @@ -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 diff --git a/bacula/src/dird/catreq.c b/bacula/src/dird/catreq.c index acf2f9801..8d54068a7 100644 --- a/bacula/src/dird/catreq.c +++ b/bacula/src/dird/catreq.c @@ -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; diff --git a/bacula/src/dird/next_vol.c b/bacula/src/dird/next_vol.c index d60df3c80..2762a2945 100644 --- a/bacula/src/dird/next_vol.c +++ b/bacula/src/dird/next_vol.c @@ -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; diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index b711efa94..140a31e71 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -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); diff --git a/bacula/src/dird/ua_purge.c b/bacula/src/dird/ua_purge.c index 075378c2c..e95e60874 100644 --- a/bacula/src/dird/ua_purge.c +++ b/bacula/src/dird/ua_purge.c @@ -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); diff --git a/bacula/src/dird/ua_update.c b/bacula/src/dird/ua_update.c index 988091def..52c050507 100644 --- a/bacula/src/dird/ua_update.c +++ b/bacula/src/dird/ua_update.c @@ -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); diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index 4aadc4f35..6312e6903 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -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, "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); diff --git a/bacula/src/stored/block_util.c b/bacula/src/stored/block_util.c index 75ed08921..5fda8b3f2 100644 --- a/bacula/src/stored/block_util.c +++ b/bacula/src/stored/block_util.c @@ -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());; } diff --git a/bacula/src/stored/dev.h b/bacula/src/stored/dev.h index 1e4f937e3..c85eb6347 100644 --- a/bacula/src/stored/dev.h +++ b/bacula/src/stored/dev.h @@ -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 */ diff --git a/bacula/updatedb/update_mysql_tables_1025_to_1026.in b/bacula/updatedb/update_mysql_tables_1025_to_1026.in index 605f9e402..f0844621c 100644 --- a/bacula/updatedb/update_mysql_tables_1025_to_1026.in +++ b/bacula/updatedb/update_mysql_tables_1025_to_1026.in @@ -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; diff --git a/bacula/updatedb/update_postgresql_tables_1025_to_1026.in b/bacula/updatedb/update_postgresql_tables_1025_to_1026.in index 35246d233..7861fb89c 100644 --- a/bacula/updatedb/update_postgresql_tables_1025_to_1026.in +++ b/bacula/updatedb/update_postgresql_tables_1025_to_1026.in @@ -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');