summaryrefslogtreecommitdiffstats
path: root/src/photorec.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-10-04 18:18:00 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-10-04 18:18:00 +0200
commit3b5e7e0ead6397c58e5347c17101df97bdaa8d93 (patch)
tree2ea932f6cd4a90cfe63286e93b7bd4c18550f588 /src/photorec.c
parentc28950032981dafb83ec5c568a16e030c4467226 (diff)
PhotoRec: limit to 200 MB when searching the previous unrecovered file
Diffstat (limited to 'src/photorec.c')
-rw-r--r--src/photorec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/photorec.c b/src/photorec.c
index 170fe59..6340b61 100644
--- a/src/photorec.c
+++ b/src/photorec.c
@@ -282,7 +282,7 @@ void get_prev_location(alloc_data_t *list_search_space, alloc_data_t **current_s
uint64_t size=0;
/* Search backward the first fragment of a file not successfully recovered
* Limit the search to 10 fragments or 1GB */
- for(nbr=0; nbr<10 && size < (uint64_t)1024*1024*1024; nbr++)
+ for(nbr=0; nbr<3 && size < (uint64_t)200*1024*1024; nbr++)
{
file_space=td_list_entry(file_space->list.prev, alloc_data_t, list);
if(file_space==list_search_space)
@@ -302,7 +302,7 @@ int get_prev_file_header(alloc_data_t *list_search_space, alloc_data_t **current
uint64_t size=0;
/* Search backward the first fragment of a file not successfully recovered
* Limit the search to 10 fragments or 1GB */
- for(nbr=0; nbr<10 && size < (uint64_t)1024*1024*1024; nbr++)
+ for(nbr=0; nbr<3 && size < (uint64_t)200*1024*1024; nbr++)
{
file_space=td_list_entry(file_space->list.prev, alloc_data_t, list);
if(file_space==list_search_space)
@@ -556,7 +556,8 @@ static void file_finish_aux(file_recovery_t *file_recovery, struct ph_param *par
if(file_recovery->file_stat!=NULL && file_recovery->file_size> 0 &&
file_recovery->file_size < file_recovery->min_filesize)
{
- log_info("File too small ( %llu < %llu), reject it\n",
+ log_info("%s File too small ( %llu < %llu), reject it\n",
+ file_recovery->filename,
(long long unsigned) file_recovery->file_size,
(long long unsigned) file_recovery->min_filesize);
file_recovery->file_size=0;