[sleuthkit-developers] Istat shows Direct Blocks incorrectly
Brought to you by:
carrier
From: Makoto S. <sh...@st...> - 2007-04-06 06:31:30
|
When the file system type is Ext, istat falls into eternal loop and shows Direct Blocks more than existing block numbers. example: [root@ns sleuthkit-2.08]# bin/istat -f ext /dev/hda1 6033 inode: 6033 Allocated Group: 3 Generation Id: 702883908 uid / gid: 0 / 0 mode: -rw-r----- size: 6 num of links: 1 Inode Times: Accessed: Fri Apr 6 14:51:52 2007 File Modified: Fri Apr 6 14:51:52 2007 Inode Modified: Fri Apr 6 14:51:52 2007 Direct Blocks: 27354 27355 27356 27357 27358 27359 27360 27361 27362 27363 27364 27365 27366 27367 27368 27369 27370 27371 27372 27373 27374 27375 27376 27377 ..... This seems to happen because of the wrong comparison of size_t value in print_addr_act(). (ext2fs.c, line 1798) for (i = 0, s = size; s > 0; s -= fs->block_size, i++) { Because the type of variable "s" is "size_t", I think this should be like the following. for (i = 0, s = size; s > 0; s = (s > fs->block_size) ? s - fs->block_size : 0, i++) { There is same code in ffs.c so it may have same problem. Hope this helps. Makoto Shiotsuki |