[Forensics-changes] [SCM] debian-forensics/safecopy branch, debian, updated. debian/1.5-1-1-g2a8a4bb
Christophe Monniez
christophe.monniez at fccu.be
Fri Oct 2 20:26:02 UTC 2009
The following commit has been merged in the debian branch:
commit 2a8a4bb292982662005ee1c55fa4124269c79278
Author: Christophe Monniez <christophe.monniez at fccu.be>
Date: Fri Oct 2 22:26:57 2009 +0200
Merging upstream version 1.6.
diff --git a/ChangeLog b/ChangeLog
index 9ac2858..aadbfc6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -59,3 +59,6 @@
- Added documentation for simulation benchmark creation.
- Moved test library in source tree and renamed to "simulator".
- Added benchmarking subproject.
+
+2009.09.09
+- Fixed a bug with badblock include file handling ( ID: 2854324 )
diff --git a/configure b/configure
index 0c84ee8..2f44f3f 100755
--- a/configure
+++ b/configure
@@ -2118,7 +2118,7 @@ fi
# Define the identity of the package.
PACKAGE=safecopy
- VERSION=1.5
+ VERSION=1.6
cat >>confdefs.h <<_ACEOF
diff --git a/configure.in b/configure.in
index 7f0e9eb..ae708c7 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
#Process this file with autoconf to produce a configure script.
AC_INIT(configure.in)
-AM_INIT_AUTOMAKE(safecopy, 1.5)
+AM_INIT_AUTOMAKE(safecopy, 1.6)
AC_PREREQ(2.5)
#AC_ISC_POSIX
diff --git a/src/safecopy.c b/src/safecopy.c
index 3261aa5..b525b6f 100644
--- a/src/safecopy.c
+++ b/src/safecopy.c
@@ -1148,12 +1148,12 @@ int main(int argc, char ** argv) {
// if so, proceed as usual,
// otherwise seek to the next badblock in input
tmp_pos=(readposition+startoffset)/iblocksize;
- if (tmp_pos>lastsourceblock) {
- tmp=NULL;
- do {
+ if (tmp_pos!=lastsourceblock) {
+ tmp=textbuffer;
+ while (tmp!=NULL && lastsourceblock<tmp_pos ) {
tmp=fgets(textbuffer,64,bblocksin);
if (sscanf(textbuffer,"%llu",&lastsourceblock)!=1) tmp=NULL;
- } while (tmp!=NULL && lastsourceblock<tmp_pos );
+ }
if (tmp==NULL) {
// no more bad blocks in input file
// if exists
diff --git a/test/test.sh b/test/test.sh
index 121f45b..82ffedc 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
source "libtestsuite.sh"
diff --git a/test/test11/test2.badblocks b/test/test12/iblocks
similarity index 54%
copy from test/test11/test2.badblocks
copy to test/test12/iblocks
index aad1393..57017a9 100644
--- a/test/test11/test2.badblocks
+++ b/test/test12/iblocks
@@ -1,9 +1,6 @@
-2
3
4
5
-9
-10
-11
12
13
+14
diff --git a/test/test9/simulator.cfg b/test/test12/simulator.cfg
similarity index 78%
copy from test/test9/simulator.cfg
copy to test/test12/simulator.cfg
index 8f0b479..bc877e4 100644
--- a/test/test9/simulator.cfg
+++ b/test/test12/simulator.cfg
@@ -2,12 +2,9 @@ blocksize=1024
filesize=20480
source=test.dat
softfailcount=2
-hardfail=2
hardfail=4
hardfail=5
hardfail=8
hardfail=9
-hardfail=10
-hardfail=11
hardfail=12
hardfail=13
diff --git a/test/test12/test.dat b/test/test12/test.dat
new file mode 100644
index 0000000..ccf6169
Binary files /dev/null and b/test/test12/test.dat differ
diff --git a/test/test12/test.sh b/test/test12/test.sh
new file mode 100755
index 0000000..5622f9f
--- /dev/null
+++ b/test/test12/test.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+test_name="safecopy, correct handling of include blocks when marking badblocks (bug #2854324)"
+
+source "../libtestsuite.sh"
+
+function test_current() {
+
+ testsuite_debug "copying reference files for safecopy"
+ cp "test1.dat" "$testsuite_tmpdir/test1.dat" >/dev/null 2>&1
+
+ testsuite_debug "Test, safecopy must not overwrite data between include blocks"
+ if ! LD_PRELOAD="$preload" $safecopy -M "MARKBAAD" -R 2 -b 1024 -f 1* -I iblocks debug "$testsuite_tmpdir/test1.dat" >"$testsuite_tmpdir/test1.out" 2>&1; then
+ testsuite_error "Run of safecopy failed. Output:"
+ testsuite_debug_file "$testsuite_tmpdir/test1.out"
+ fi
+ testsuite_assert_files_identical "test1.dat" "$testsuite_tmpdir/test1.dat"
+
+
+}
+
+testsuite_runtest
+
diff --git a/test/test12/test1.dat b/test/test12/test1.dat
new file mode 100644
index 0000000..6ad02e4
Binary files /dev/null and b/test/test12/test1.dat differ
--
debian-forensics/safecopy
More information about the forensics-changes
mailing list