* Read message digest of bfd, updating digest
* In case of errors we need the job control record and file name.
*/
-int read_digest(BFILE *bfd, DIGEST *digest, JCR *jcr)
+static int read_digest(BFILE *bfd, DIGEST *digest, JCR *jcr)
{
char buf[DEFAULT_NETWORK_BUFFER_SIZE];
int64_t n;
+ int64_t bufsiz = (int64_t)sizeof(buf);
+ FF_PKT *ff_pkt = (FF_PKT *)jcr->ff;
+ uint64_t fileAddr = 0; /* file address */
+
Dmsg0(50, "=== read_digest\n");
- while ((n=bread(bfd, buf, sizeof(buf))) > 0) {
+ while ((n=bread(bfd, buf, bufsiz)) > 0) {
+ /* Check for sparse blocks */
+ if (ff_pkt->flags & FO_SPARSE) {
+ bool haveBlock = true;
+ if (n == bufsiz &&
+ fileAddr+n < (uint64_t)ff_pkt->statp.st_size ||
+ ((ff_pkt->type == FT_RAW || ff_pkt->type == FT_FIFO) &&
+ (uint64_t)ff_pkt->statp.st_size == 0)) {
+ haveBlock = !is_buf_zero(buf, bufsiz);
+ }
+ fileAddr += n; /* update file address */
+ if (!haveBlock) {
+ continue; /* skip block of zeros */
+ }
+ }
+
crypto_digest_update(digest, (uint8_t *)buf, n);
jcr->JobBytes += n;
jcr->ReadBytes += n;
bool load_plugins(void *binfo, void *bfuncs, const char *plugin_dir, const char *type)
{
bool found = false;
-#ifndef HAVE_WIN32
+//#ifndef HAVE_WIN32
t_loadPlugin loadPlugin;
Plugin *plugin;
DIR* dp = NULL;
if (dp) {
closedir(dp);
}
-#endif
+//#endif
return found;
}
*/
void unload_plugins()
{
-#ifndef HAVE_WIN32
+//#ifndef HAVE_WIN32
Plugin *plugin;
if (!plugin_list) {
}
delete plugin_list;
plugin_list = NULL;
-#endif
+//#endif
}
#define __PLUGINS_H
#include "bacula.h"
-#ifndef HAVE_WIN32
#include <dlfcn.h>
-#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#define NAMELEN(dirent) (strlen((dirent)->d_name))
-
-// vss.cpp -- Interface to Volume Shadow Copies (VSS)
-//
-// Copyright transferred from MATRIX-Computer GmbH to
-// Kern Sibbald by express permission.
-//
-// Author : Thorsten Engel
-// Created On : Fri May 06 21:44:00 2005
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2005-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2005-2008 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.
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+// vss.cpp -- Interface to Volume Shadow Copies (VSS)
+//
+// Copyright transferred from MATRIX-Computer GmbH to
+// Kern Sibbald by express permission.
+//
+// Author : Thorsten Engel
+// Created On : Fri May 06 21:44:00 2005
#ifdef WIN32_VSS
atexit(VSSCleanup);
return;
}
- /* Vista or Longhorn */
- } else if (g_MajorVersion == 6 && g_MinorVersion == 0) {
- /* Probably will not work */
+ /* Vista or Longhorn or later */
+// } else if (g_MajorVersion == 6 && g_MinorVersion == 0) {
+ } else if (g_MajorVersion >= 6) {
g_pVSSClient = new VSSClientVista();
atexit(VSSCleanup);
return;
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2005-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2005-2008 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.
General:
09Sep08
+kes Enable Win32 plugin load code in lib.
+kes Make Verify code that computes disk checksums use the same
+ algorithm as backup when dealing with sparse files.
+kes Attempt to run VSS on any systems newer than Vista -- should
+ make it work on Windows Server 2008.
ebl Change the new statistic implementation. Remove the UseStatistic
- directive and add a "update stats [days=...]" command. You can
+ directive and add a 'update stats [days=...]' command. You can
now decide when copy job records from Job table to JobStat.
Statistics are much more accurate with this.
08Sep08
kes Add dbuser to DIR conf file (replaces user).
kes Add --with-db-password to ./configure
kes Fix regress to handle db_password.
-ebl Add new "status storage slots" that list autochanger
+ebl Add new 'status storage slots' that list autochanger
content.
ebl Update vtape driver to compile only under Linux.
ebl Fix a bug when restoring with a wrong mediatype.