X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fstored%2Flabel.c;h=8df3339a464de7ddfbc49de27f27cb5be0155b5f;hb=36b40d5c7f3ff90565ab73ac75f0dc4f6660ff37;hp=e2b9f548ea89dde27a87343277a87dd14dd1dd3b;hpb=ce462cd94d90f4785b622cedc2ca48d616fe3f07;p=bacula%2Fbacula diff --git a/bacula/src/stored/label.c b/bacula/src/stored/label.c index e2b9f548ea..8df3339a46 100644 --- a/bacula/src/stored/label.c +++ b/bacula/src/stored/label.c @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - Bacula® is a registered trademark of John Walker. + Bacula® is a registered trademark of Kern Sibbald. The licensor of Bacula is the Free Software Foundation Europe (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. @@ -85,27 +85,6 @@ int read_dev_volume_label(DCR *dcr) return VOL_IO_ERROR; } } -#ifdef xxx - if (dev->is_labeled()) { /* did we already read label? */ - /* Compare Volume Names allow special wild card */ - if (VolName && *VolName && *VolName != '*' && strcmp(dev->VolHdr.VolumeName, VolName) != 0) { - Mmsg(jcr->errmsg, _("Wrong Volume mounted on device %s: Wanted %s have %s\n"), - dev->print_name(), VolName, dev->VolHdr.VolumeName); - /* - * Cancel Job if too many label errors - * => we are in a loop - */ - if (!dev->poll && jcr->label_errors++ > 100) { - Jmsg(jcr, M_FATAL, 0, _("Too many tries: %s"), jcr->errmsg); - } - Dmsg0(150, "return VOL_NAME_ERROR\n"); - stat = VOL_NAME_ERROR; - goto bail_out; - } - Dmsg0(130, "Leave read_volume_label() VOL_OK\n"); - return VOL_OK; /* label already read */ - } -#endif dev->clear_labeled(); dev->clear_append(); @@ -324,6 +303,10 @@ bool write_new_volume_label_to_dev(DCR *dcr, const char *VolName, Dmsg0(150, "write_volume_label()\n"); empty_block(dcr->block); + if (*VolName == 0) { + Pmsg0(0, "=== ERROR: write_new_volume_label_to_dev called with NULL VolName\n"); + goto bail_out; + } if (relabel) { volume_unused(dcr); /* mark current volume unused */ @@ -684,8 +667,8 @@ void create_session_label(DCR *dcr, DEV_RECORD *rec, int label) /* Added in VerNum 10 */ ser_string(jcr->Job); /* Unique name of this Job */ ser_string(jcr->fileset_name); - ser_uint32(jcr->JobType); - ser_uint32(jcr->JobLevel); + ser_uint32(jcr->get_JobType()); + ser_uint32(jcr->get_JobLevel()); /* Added in VerNum 11 */ ser_string(jcr->fileset_md5);