summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2019-11-01 10:56:57 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2019-11-01 10:56:57 +0100
commit87ff1ddb86b0869839c9ede8168e8418d2a196e1 (patch)
tree25b494294ebbfdb7bd22eb5206ad44acab6e90fc
parent91ba106b2523a64b7f1dd18e6d32f4b50d1509a9 (diff)
Do not call utime() when using frama-c, fix some minor warnings.
-rw-r--r--Makefile.am20
-rw-r--r--configure.ac2
-rw-r--r--src/file_exe.c2
-rw-r--r--src/file_m2ts.c2
-rw-r--r--src/file_mp3.c2
-rw-r--r--src/setdate.c2
6 files changed, 18 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am
index 7f41dd2..0ccabc1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -80,6 +80,18 @@ extras:
extrasstatic:
$(MAKE) LDFLAGS="$(LDFLAGS) -static" LIBS="$(PTHREAD_LIBS) $(LIBS)" CFLAGS="$(PTHREAD_CFLAGS) $(CFLAGS)" CXXFLAGS="$(PTHREAD_CFLAGS) $(CXXFLAGS)" extras
+session_doc.framac: src/file_doc.c src/common.c src/filegen.c src/log.c src/setdate.c
+ gcc -W -Wall -DMAIN_doc -DHAVE_CONFIG_H -O -o demo -I. $^
+ frama-c $^ -cpp-extra-args="-DMAIN_doc -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@
+
+session_id3.framac: src/file_mp3.c src/common.c src/filegen.c src/log.c
+ gcc -W -Wall -DMAIN_id3 -DHAVE_CONFIG_H -O -o demo -I. $^
+ frama-c $^ -cpp-extra-args="-DMAIN_id3 -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@
+
+session_jpg.framac: src/file_jpg.c src/common.c src/filegen.c src/log.c src/suspend_no.c src/setdate.c
+ gcc -W -Wall -DMAIN_jpg -DHAVE_CONFIG_H -O -o demo -I. $^ -ljpeg
+ frama-c $^ -cpp-extra-args="-DMAIN_jpg -DHAVE_CONFIG_H -D__x86_64__ -I/usr/include -I $(frama-c -print-path)/libc" $(FRAMA_C_FLAGS) -save $@
+
session_tiff_be.framac: src/file_tiff.c src/file_tiff_be.c src/file_tiff_le.c src/common.c src/filegen.c src/log.c
gcc -W -Wall -DMAIN_tiff_le -DHAVE_CONFIG_H -O -o demo -I. $^
frama-c $^ -cpp-extra-args="-DMAIN_tiff_le -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@
@@ -88,14 +100,6 @@ session_tiff_le.framac: src/file_tiff.c src/file_tiff_be.c src/file_tiff_le.c sr
gcc -W -Wall -DMAIN_tiff_le -DHAVE_CONFIG_H -O -o demo -I. $^
frama-c $^ -cpp-extra-args="-DMAIN_tiff_le -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@
-session_id3.framac: src/file_mp3.c src/common.c src/filegen.c src/log.c
- gcc -W -Wall -DMAIN_id3 -DHAVE_CONFIG_H -O -o demo -I. $^
- frama-c $^ -cpp-extra-args="-DMAIN_id3 -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@
-
-session_doc.framac: src/file_doc.c src/common.c src/filegen.c src/log.c src/setdate.c
- gcc -W -Wall -DMAIN_doc -DHAVE_CONFIG_H -O -o demo -I. $^
- frama-c $^ -cpp-extra-args="-DMAIN_doc -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@
-
session_%.framac: src/file_%.c src/common.c src/filegen.c src/log.c
gcc -W -Wall -DMAIN_$* -DHAVE_CONFIG_H -O -o demo -I. $^
frama-c $^ -cpp-extra-args="-DMAIN_$* -DHAVE_CONFIG_H -D__x86_64__" $(FRAMA_C_FLAGS) -save $@
diff --git a/configure.ac b/configure.ac
index 388e952..40ee68d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ AC_INIT([testdisk],[7.2-WIP],[grenier@cgsecurity.org])
AC_LANG(C)
sinclude(acx_pthread.m4)
sinclude(mkdir.m4)
-TESTDISKDATE="July 2019"
+TESTDISKDATE="November 2019"
AC_SUBST(TESTDISKDATE)
AC_DEFINE_UNQUOTED([TESTDISKDATE],"$TESTDISKDATE",[Date of release])
AC_CONFIG_AUX_DIR(config)
diff --git a/src/file_exe.c b/src/file_exe.c
index dd82e25..ade58b0 100644
--- a/src/file_exe.c
+++ b/src/file_exe.c
@@ -912,7 +912,7 @@ int main()
file_stats.file_hint=&file_hint_exe;
file_stats.not_recovered=0;
file_stats.recovered=0;
- file_hint_exe.register_header_check(&file_stats);
+ register_header_check_exe(&file_stats);
if(header_check_exe(buffer, BLOCKSIZE, 0u, &file_recovery, &file_recovery_new)!=1)
return 0;
/*@ assert valid_read_string((char *)&fn); */
diff --git a/src/file_m2ts.c b/src/file_m2ts.c
index ca3a7bf..3a8a456 100644
--- a/src/file_m2ts.c
+++ b/src/file_m2ts.c
@@ -120,7 +120,7 @@ static int header_check_m2ts(const unsigned char *buffer, const unsigned int buf
if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_m2ts &&
(file_recovery->data_check==&data_check_ts_192 ||
- file_recovery->blocksize < 5))
+ file_recovery_new->blocksize < 5))
{
header_ignored(file_recovery_new);
return 0;
diff --git a/src/file_mp3.c b/src/file_mp3.c
index 65950a1..25d688a 100644
--- a/src/file_mp3.c
+++ b/src/file_mp3.c
@@ -665,7 +665,7 @@ int main()
file_stats.file_hint=&file_hint_mp3;
file_stats.not_recovered=0;
file_stats.recovered=0;
- file_hint_mp3.register_header_check(&file_stats);
+ register_header_check_mp3(&file_stats);
if(header_check_id3(buffer, BLOCKSIZE, 0u, &file_recovery, &file_recovery_new) != 1)
return 0;
/*@ assert valid_read_string((char *)&fn); */
diff --git a/src/setdate.c b/src/setdate.c
index d05e716..5e26e1a 100644
--- a/src/setdate.c
+++ b/src/setdate.c
@@ -49,10 +49,12 @@ int set_date(const char *pathname, time_t actime, time_t modtime)
return -1;
ut.actime = actime;
ut.modtime = modtime;
+#ifndef __FRAMAC__
if (utime(pathname, &ut)) {
log_error("ERROR: Couldn't set the file's date and time for %s\n", pathname);
return -1;
}
#endif
+#endif
return 0;
}