- Eric fixed RunScripts, which I (Kern) had broken in the last beta.
- Correct Client migration SQL as pointed out by Marc.
+==== IMPORTANT =====
+- The database format has been updated from what was used in
+ Bacula 1.38.x. You must manually update your database before
+ running Bacula 1.39.x or higher. Please backup your previous
+ version of the database before running the update. The update
+ script will be automatically installed in your scripts directory,
+ or can also be found in <bacula-source>/src/cats. It is called:
+
+ ./update_bacula_tables
+
+ It is necessary to run it only once the first time you move to a
+ 1.39.x beta or to 1.40.0. Upgrading the Bacula version thereafter
+ does not require updating the database again. Depending on the size of your
+ database the script make take a bit of time, to run, but in
+ general, it should be very fast.
+
New Features in 1.40.0 (beginning of release info)
- There is a new cross-compiled Win32 File daemon that now has all the features
that were previously only in the Unix versions.
Warning for version 1.39.18 and greater:
- The documentation is almost non-existent for all new features
except RunScripts (written and documented by Eric Bollengier).
-- If you have an old pre 1.39.18 database, you must upgrade it using
- the upgrade_bacula_tables script. Please backup your database before
- upgrading just in case.
+- If you have an old pre 1.39.18 database, you must update it using
+ the update_bacula_tables script. Please backup your database before
+ updating just in case.
- You *should* be able to use 1.38.x FDs with version 1.39.18 Director
and SD providing you do not use any of the new features (runscript,
data encryption). It seems to work here, but we do not guarantee it.
if (ua->argc == 1) {
bsendmsg(ua, _("No file specification given.\n"));
- return 0;
+ return 1; /* make it non-fatal */
}
for (int i=1; i < ua->argc; i++) {
Dmsg3(100, "Tests : %d %d %d\n", (dev->VolCatInfo.VolCatParts > 0),
((dev->file_addr-dev->part_start) == dev->part_size),
(dev->part <= dev->VolCatInfo.VolCatParts));*/
+
/* Check for DVD part file end */
if (dev->at_eof() && dev->is_dvd() && dev->num_dvd_parts > 0 &&
dev->part < dev->num_dvd_parts) {
+ Dmsg0(400, "Call dvd_open_next_part\n");
if (dvd_open_next_part(dcr) < 0) {
Jmsg3(dcr->jcr, M_FATAL, 0, _("Unable to open device part=%d %s: ERR=%s\n"),
dev->part, dev->print_name(), dev->bstrerror());
if (block->read_len > block->block_len && !dev->is_tape()) {
char ed1[50];
off_t pos = lseek_dev(dev, (off_t)0, SEEK_CUR); /* get curr pos */
+ Dmsg1(200, "Current lseek pos=%s\n", edit_int64(pos, ed1));
pos -= (block->read_len - block->block_len);
lseek_dev(dev, pos, SEEK_SET);
Dmsg3(200, "Did lseek pos=%s blk_size=%d rdlen=%d\n",
- edit_uint64(pos, ed1), block->block_len,
+ edit_int64(pos, ed1), block->block_len,
block->read_len);
dev->file_addr = pos;
dev->file_size = pos;
bool first = true;
Dmsg3(400, "rewind res=%d fd=%d %s\n", reserved_device, fd, print_name());
+ state &= ~(ST_EOT|ST_EOF|ST_WEOT); /* remove EOF/EOT flags */
+ block_num = file = 0;
+ file_size = 0;
+ file_addr = 0;
if (fd < 0) {
if (!is_dvd()) { /* In case of major error, the fd is not open on DVD, so we don't want to abort. */
dev_errno = EBADF;
}
return false;
}
- state &= ~(ST_EOT|ST_EOF|ST_WEOT); /* remove EOF/EOT flags */
- block_num = file = 0;
- file_size = 0;
- file_addr = 0;
if (is_tape()) {
mt_com.mt_op = MTREW;
mt_com.mt_count = 1;
memcpy(&dev->VolCatInfo, &dcr->VolCatInfo, sizeof(dev->VolCatInfo));
/*
- * If we have a part open for write, then write it to
+ * If we have a spooled part open, write it to the
* DVD before opening the next part.
*/
- if (dev->part > dev->num_dvd_parts && dev->can_append()) {
+ if (dev->is_part_spooled()) {
Dmsg2(100, "Before open next write previous. part=%d num_parts=%d\n",
dev->part, dev->num_dvd_parts);
if (!dvd_write_part(dcr)) {
off_t pos;
char ed1[50], ed2[50];
- Dmsg3(400, "Enter lseek_dev fd=%d part=%d nparts=%d\n", dev->fd,
- dev->part, dev->num_dvd_parts);
+ Dmsg5(400, "Enter lseek_dev fd=%d off=%s w=%d part=%d nparts=%d\n", dev->fd,
+ edit_int64(offset, ed1), whence, dev->part, dev->num_dvd_parts);
if (!dev->is_dvd()) {
Dmsg0(400, "Using sys lseek\n");
return lseek(dev->fd, offset, whence);
}
- /* Return I/O error ... no part */
- if (dev->part > dev->num_dvd_parts) {
- return 0;
- }
-
dcr = (DCR *)dev->attached_dcrs->first(); /* any dcr will do */
switch(whence) {
case SEEK_SET:
Dmsg2(400, "lseek_dev SEEK_SET to %s (part_start=%s)\n",
- edit_uint64(offset, ed1), edit_uint64(dev->part_start, ed2));
+ edit_int64(offset, ed1), edit_uint64(dev->part_start, ed2));
if ((uint64_t)offset >= dev->part_start) {
- if ((uint64_t)offset < dev->part_start+dev->part_size) {
+ if ((uint64_t)offset == dev->part_start ||
+ (uint64_t)offset < dev->part_start+dev->part_size) {
/* We are staying in the current part, just seek */
if ((pos = lseek(dev->fd, offset-dev->part_start, SEEK_SET)) < 0) {
return pos;
}
break;
case SEEK_CUR:
- Dmsg1(400, "lseek_dev SEEK_CUR to %s\n", edit_uint64(offset, ed1));
+ Dmsg1(400, "lseek_dev SEEK_CUR to %s\n", edit_int64(offset, ed1));
if ((pos = lseek(dev->fd, (off_t)0, SEEK_CUR)) < 0) {
- return pos;
+ Dmsg0(400, "Seek error.\n");
+ return pos;
}
pos += dev->part_start;
if (offset == 0) {
Dmsg1(400, "lseek_dev SEEK_CUR returns %s\n", edit_uint64(pos, ed1));
return pos;
- } else { /* Not used in Bacula, but should work */
+ } else {
+ Dmsg1(400, "do lseek_dev SEEK_SET %s\n", edit_uint64(pos, ed1));
return lseek_dev(dev, pos, SEEK_SET);
}
break;
case SEEK_END:
- Dmsg1(400, "lseek_dev SEEK_END to %s\n", edit_uint64(offset, ed1));
+ Dmsg1(400, "lseek_dev SEEK_END to %s\n", edit_int64(offset, ed1));
/*
* Bacula does not use offsets for SEEK_END
* Also, Bacula uses seek_end only when it wants to
}
break;
default:
+ Dmsg0(400, "Seek call error.\n");
errno = EINVAL;
return -1;
}
#undef VERSION
#define VERSION "1.39.21"
-#define BDATE "30 August 2006"
-#define LSMDATE "30Aug06"
+#define BDATE "31 August 2006"
+#define LSMDATE "31Aug06"
#define BYEAR "2006" /* year for copyright messages in progs */
/* Debug flags */
Technical notes on version 1.39
General:
+31Aug06
+kes Make find with no args in tree restore return error rather than
+ stopping the selection. Fixes bug #665
+kes Rework DVD writing to ensure that the last part is written
+ on open_next_part when dealing with a spool file.
+kes Correct the lseek_dev() routine to handle end point correctly
+ (bug introduced by me).
+kes Allow part number to exceed num_dvd_parts in lseek_dev().
30Aug06
kes Apply dvd-handler patch from Richard Mortimer.
kes Apply dvd error check patch from Richard Mortimer.