From 7111681b7a659ac6ea5a9e56ddd9372b31e6eccf Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 15 Aug 2008 16:58:28 +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. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7479 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/2.4.2-verify.patch | 36 +++++++++++++++++++++++++++++++ bacula/src/dird/fd_cmds.c | 3 +-- bacula/technotes-2.4 | 3 +++ 3 files changed, 40 insertions(+), 2 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 7479a73056..c630a90b74 100644 --- a/bacula/src/dird/fd_cmds.c +++ b/bacula/src/dird/fd_cmds.c @@ -616,7 +616,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); @@ -641,7 +640,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/technotes-2.4 b/bacula/technotes-2.4 index 836404ffef..9dcc002d66 100644 --- a/bacula/technotes-2.4 +++ b/bacula/technotes-2.4 @@ -2,6 +2,9 @@ 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. kes Add space after version before date in bat about dialog. 12Aug08 kes Fix seg fault in Dir during estimate command with no level value -- 2.39.5