/*
Bacula® - The Network Backup Solution
- Copyright (C) 2005-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2005-2009 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.
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.
}
*q = 0;
Dmsg0(100, "Call reserve_volume\n");
+ /* ***FIXME*** why is this reserve_volume() needed???? KES */
reserve_volume(dcr, dev->VolHdr.VolumeName);
dev = dcr->dev; /* may have changed in reserve_volume */
Dmsg2(100, "Wanted ANSI Vol %s got %6s\n", VolName, dev->VolHdr.VolumeName);
{
DEVICE *dev = dcr->dev;
JCR *jcr = dcr->jcr;
+ char ansi_volname[7]; /* 6 char + \0 */
char label[80]; /* tape label */
char date[20]; /* ansi date buffer */
time_t now;
VolName);
return false;
}
+ /* ANSI labels have 6 characters, and are padded with spaces
+ * 'vol1\0' => 'vol1 \0'
+ */
+ strcpy(ansi_volname, VolName);
+ for(int i=len; i < 6; i++) {
+ ansi_volname[i]=' ';
+ }
+ ansi_volname[6]='\0'; /* only for debug */
+
if (type == ANSI_VOL_LABEL) {
ser_begin(label, sizeof(label));
ser_bytes("VOL1", 4);
- ser_bytes(VolName, len);
+ ser_bytes(ansi_volname, 6);
/* Write VOL1 label */
if (label_type == B_IBM_LABEL) {
ascii_to_ebcdic(label, label, sizeof(label));
ser_bytes("1", 1);
ser_bytes("BACULA.DATA", 11); /* Filename field */
ser_begin(&label[21], sizeof(label)-21); /* fileset field */
- ser_bytes(VolName, len); /* write Vol Ser No. */
+ ser_bytes(ansi_volname, 6); /* write Vol Ser No. */
ser_begin(&label[27], sizeof(label)-27);
ser_bytes("00010001000100", 14); /* File section, File seq no, Generation no */
now = time(NULL);