From 6d99238bab7e8b723c2320d2c71ec92fc30e7b89 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 15 Aug 2008 16:56:02 +0000 Subject: [PATCH] Fix a Verify InitCatalog problem where in certain cases a garbage filename may be entered in the verification database. This fixes bug #1143. 13Aug08 kes Add VSS 64 bit dll entry point in src/win32/filed/vss_generic.cpp sent in by Riyas Yoosuf. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7478 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/2.4.2-verify.patch | 36 ++++++++++++++++++++++++++ bacula/src/dird/fd_cmds.c | 3 +-- bacula/src/dird/getmsg.c | 6 ++--- bacula/src/win32/filed/vss_generic.cpp | 4 +++ bacula/technotes-2.5 | 7 +++++ 5 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 bacula/patches/2.4.2-verify.patch diff --git a/bacula/patches/2.4.2-verify.patch b/bacula/patches/2.4.2-verify.patch new file mode 100644 index 0000000000..5ec0db1706 --- /dev/null +++ b/bacula/patches/2.4.2-verify.patch @@ -0,0 +1,36 @@ + + This patch corrects a Verify InitCatalog problem where in certain cases + a garbage filename may be entered in the verification database. This + fixes bug #1143. + + Apply the patch to version 2.4.2 (and previous versions) with: + + cd + patch -p0 <2.4.2-verify.patch + ./configure + make + ... + make install + + +Index: src/dird/fd_cmds.c +=================================================================== +--- src/dird/fd_cmds.c (revision 7469) ++++ src/dird/fd_cmds.c (working copy) +@@ -616,7 +616,6 @@ + char *p, *fn; + char Digest[MAXSTRING]; /* either Verify opts or MD5/SHA1 digest */ + +- jcr->fname = check_pool_memory_size(jcr->fname, fd->msglen); + if ((len = sscanf(fd->msg, "%ld %d %s", &file_index, &stream, Digest)) != 3) { + Jmsg(jcr, M_FATAL, 0, _("msglen, fd->msg); +@@ -641,7 +640,7 @@ + } + } + /* Any cached attr is flushed so we can reuse jcr->attr and jcr->ar */ +- fn = jcr->fname; ++ fn = jcr->fname = check_pool_memory_size(jcr->fname, fd->msglen); + while (*p != 0) { + *fn++ = *p++; /* copy filename */ + } diff --git a/bacula/src/dird/fd_cmds.c b/bacula/src/dird/fd_cmds.c index 889b5d7b9f..2f1d3bd79c 100644 --- a/bacula/src/dird/fd_cmds.c +++ b/bacula/src/dird/fd_cmds.c @@ -672,7 +672,6 @@ int get_attributes_and_put_in_catalog(JCR *jcr) char *p, *fn; char Digest[MAXSTRING]; /* either Verify opts or MD5/SHA1 digest */ - jcr->fname = check_pool_memory_size(jcr->fname, fd->msglen); if ((len = sscanf(fd->msg, "%ld %d %s", &file_index, &stream, Digest)) != 3) { Jmsg(jcr, M_FATAL, 0, _("msglen, fd->msg); @@ -697,7 +696,7 @@ int get_attributes_and_put_in_catalog(JCR *jcr) } } /* Any cached attr is flushed so we can reuse jcr->attr and jcr->ar */ - fn = jcr->fname; + fn = jcr->fname = check_pool_memory_size(jcr->fname, fd->msglen); while (*p != 0) { *fn++ = *p++; /* copy filename */ } diff --git a/bacula/src/dird/getmsg.c b/bacula/src/dird/getmsg.c index abc3ac8551..ec1c16cf00 100644 --- a/bacula/src/dird/getmsg.c +++ b/bacula/src/dird/getmsg.c @@ -80,9 +80,9 @@ void set_jcr_sd_job_status(JCR *jcr, int SDJobStatus) case JS_WaitMedia: case JS_WaitMount: case JS_WaitMaxJobs: - set_waittime = true; + set_waittime = true; default: - break; + break; } if (job_waiting(jcr)) { @@ -134,7 +134,7 @@ int bget_dirmsg(BSOCK *bs) for (;;) { n = bs->recv(); - Dmsg2(100, "bget_dirmsg %d: %s\n", n, bs->msg); + Dmsg2(300, "bget_dirmsg %d: %s\n", n, bs->msg); if (is_bnet_stop(bs)) { return n; /* error or terminate */ diff --git a/bacula/src/win32/filed/vss_generic.cpp b/bacula/src/win32/filed/vss_generic.cpp index da2fbea90d..48551836a2 100644 --- a/bacula/src/win32/filed/vss_generic.cpp +++ b/bacula/src/win32/filed/vss_generic.cpp @@ -118,7 +118,11 @@ class IXMLDOMDocument; static t_CreateVssBackupComponents p_CreateVssBackupComponents = NULL; static t_VssFreeSnapshotProperties p_VssFreeSnapshotProperties = NULL; +#ifdef _WIN64 + #define VSSVBACK_ENTRY "?CreateVssBackupComponents@@YAJPEAPEAVIVssBackupComponents@@@Z" +#else #define VSSVBACK_ENTRY "?CreateVssBackupComponents@@YGJPAPAVIVssBackupComponents@@@Z" +#endif #include "vss.h" diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index a7453becf0..d4e6b39234 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -32,6 +32,13 @@ separator in console (!$%&'()*+,-/:;<>?[]^`{|}~) General: +14Aug08 +kes Fix a Verify InitCatalog problem where in certain cases + a garbage filename may be entered in the verification database. This + fixes bug #1143. +13Aug08 +kes Add VSS 64 bit dll entry point in src/win32/filed/vss_generic.cpp + sent in by Riyas Yoosuf. 12Aug08 kes Fix seg fault in Dir during estimate command with no level value given. This fixes bug #1140. -- 2.39.5