On Wednesday, 24 August 2016 23:42:05 CEST Matteo Cafasso wrote:
With the current implementation, the root inode of the given partition is ignored.
The root inode is now reported. Its name will be a single dot '.' reproducing the TSK API.
Signed-off-by: Matteo Cafasso <noxdafox@gmail.com> --- daemon/tsk.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/daemon/tsk.c b/daemon/tsk.c index dd368d7..4a0517b 100644 --- a/daemon/tsk.c +++ b/daemon/tsk.c @@ -114,9 +114,12 @@ fswalk_callback (TSK_FS_FILE *fsfile, const char *path, void *data) struct guestfs_int_tsk_dirent dirent;
/* Ignore ./ and ../ */ - ret = TSK_FS_ISDOT (fsfile->name->name); - if (ret != 0) - return TSK_WALK_CONT; + if (TSK_FS_ISDOT (fsfile->name->name)) { + /* Root is represented as . */ + if (fsfile->fs_info->root_inum != fsfile->name->meta_addr || + strcmp (fsfile->name->name, ".")) + return TSK_WALK_CONT; + }
Considering that this snippet is duplicated in the additions of the other patch series ("New API: find_inode"), I'd rather see the common parts factorised already when doing this change. Thanks, -- Pino Toscano