]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix a Verify InitCatalog problem where in certain cases
authorKern Sibbald <kern@sibbald.com>
Fri, 15 Aug 2008 16:58:28 +0000 (16:58 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 15 Aug 2008 16:58:28 +0000 (16:58 +0000)
     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 [new file with mode: 0644]
bacula/src/dird/fd_cmds.c
bacula/technotes-2.4

diff --git a/bacula/patches/2.4.2-verify.patch b/bacula/patches/2.4.2-verify.patch
new file mode 100644 (file)
index 0000000..5ec0db1
--- /dev/null
@@ -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 <bacula-source>
+  patch -p0 <2.4.2-verify.patch
+  ./configure <your-options>
+  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, _("<filed: bad attributes, expected 3 fields got %d\n"
+ "msglen=%d msg=%s\n"), len, fd->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 */
+          }
index 7479a7305635a28a7b386d7a21aaac8ab5e94ac0..c630a90b745d18fe4dd4866e327f7db60e4cf51c 100644 (file)
@@ -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, _("<filed: bad attributes, expected 3 fields got %d\n"
 "msglen=%d msg=%s\n"), len, fd->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 */
          }
index 836404ffef3667fca355390d053af2b590e4b5aa..9dcc002d6665619d2ad5d253ee507cb1cac32345 100644 (file)
@@ -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