]> git.wh0rd.org - dump.git/commitdiff
Fix invalid EA metainformation in dump, add a workaround to restore to
authorStelian Pop <stelian@popies.net>
Mon, 22 Mar 2010 15:40:55 +0000 (15:40 +0000)
committerStelian Pop <stelian@popies.net>
Mon, 22 Mar 2010 15:40:55 +0000 (15:40 +0000)
cope with the invalid entries.

CHANGES
dump/traverse.c
restore/tape.c

diff --git a/CHANGES b/CHANGES
index 439ccc7ca6ad03488046fa021355146ad22bb139..ae9f2836b0148fd09f94c4e6dac8c630360916a8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.308 2010/03/08 10:57:24 stelian Exp $
+$Id: CHANGES,v 1.309 2010/03/22 15:40:55 stelian Exp $
 
 Changes between versions 0.4b42 and 0.4b43 (released ?????????????)
 ===================================================================
@@ -27,6 +27,13 @@ Changes between versions 0.4b42 and 0.4b43 (released ?????????????)
 
 6.     Make the dump man page explicit about ext4 support.
 
+7.     Fix a bug in dump which caused EA entries to be unrecognizable by
+       restore in some corner cases. Add a workaround to restore making
+       it able to properly deal with those corrupted EA entries. Thanks
+       to John Austin <jaustin1@users.sourceforge.net> for reporting
+       the bug.
+
+
 Changes between versions 0.4b41 and 0.4b42 (released June 18, 2009)
 ===================================================================
 
index ac9db80d57ca576affc8f013a854f1d6c608599e..18892180712b57e807a466d5eb4870d34e6e9490 100644 (file)
@@ -37,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: traverse.c,v 1.67 2009/06/18 10:00:38 stelian Exp $";
+       "$Id: traverse.c,v 1.68 2010/03/22 15:40:55 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -833,6 +833,8 @@ dump_xattr(dump_ino_t ino, struct dinode *dp) {
                        spcl.c_flags |= DR_EXTATTRIBUTES;
                        spcl.c_extattributes = EXT_XATTR;
                        spcl.c_count = howmany(EXT2_INODE_SIZE(fs->super), TP_BSIZE);
+                       for (i = 0; i < spcl.c_count; i++)
+                               spcl.c_addr[i] = 1;
                        writeheader(ino);
                        for (i = 0, cp = xattr; i < spcl.c_count; i++, cp += TP_BSIZE)
                                writerec(cp, 0);
index 02892464bdd4d73572e119cfb7ece65a359615a3..3dc8bbaf7feb89560c699b8bb7d95b9f4439fa45 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.95 2009/12/04 16:29:18 stelian Exp $";
+       "$Id: tape.c,v 1.96 2010/03/22 15:40:55 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -1238,12 +1238,20 @@ readxattr(char *buffer)
                skipfile();
                return (FAIL);
        }
-       
+
        memset(xattrbuf, 0, XATTR_MAXSIZE);
        xattrlen = 0;
 
+       /*
+        * ugly hack: cope with invalid spcl.c_addr[] records written by
+        * old versions of dump.
+        */
+       readmapflag = 1;
+
        getfile(xtrxattr, xtrnull);
 
+       readmapflag = 0;
+
        memcpy(buffer, xattrbuf, XATTR_MAXSIZE);
 
        return (GOOD);