Skip to content

Commit

Permalink
Added support for inode 0 in TSKPathSpec #320 (#321)
Browse files Browse the repository at this point in the history
* Added support for inode 0 in TSKPathSpec #320
  • Loading branch information
joachimmetz authored and Onager committed Nov 21, 2018
1 parent 02bf8e5 commit 7fbc860
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dfvfs/path/tsk_path_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def __init__(
Raises:
ValueError: when inode and location, or parent are not set.
"""
if (not inode and not location) or not parent:
# Note that pytsk/libtsk overloads inode and a value of 0 is valid in
# contrast to an ext file system.
if (inode is None and not location) or not parent:
raise ValueError('Missing inode and location, or parent value.')

super(TSKPathSpec, self).__init__(parent=parent, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion tests/path/tsk_path_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def testInitialize(self):
self.assertIsNotNone(path_spec)

path_spec = tsk_path_spec.TSKPathSpec(
inode=1, parent=self._path_spec)
inode=0, parent=self._path_spec)

self.assertIsNotNone(path_spec)

Expand Down

0 comments on commit 7fbc860

Please sign in to comment.