Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for using the correct volume name to mount filesystems in Unix #677

Merged
merged 5 commits into from
Jul 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dissect/target/plugins/os/unix/_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ def _add_mounts(self) -> None:
fs_id = None
fs_subvol = None
fs_subvolid = None
fs_volume_name = fs.volume.name if fs.volume and not isinstance(fs.volume, list) else None
fs_last_mount = None
fs_volume_name = None
vol_volume_name = fs.volume.name if fs.volume and not isinstance(fs.volume, list) else None

if fs.__type__ == "xfs":
fs_id = fs.xfs.uuid
Expand All @@ -224,8 +225,9 @@ def _add_mounts(self) -> None:

if (
(fs_id and (fs_id == dev_id and (subvol == fs_subvol or subvolid == fs_subvolid)))
or (fs_volume_name and (fs_volume_name == volume_name))
or (fs_last_mount and (fs_last_mount == mount_point))
or (fs_volume_name and (fs_volume_name == volume_name))
or (vol_volume_name and (vol_volume_name == volume_name))
):
self.target.log.debug("Mounting %s (%s) at %s", fs, fs.volume, mount_point)
self.target.fs.mount(mount_point, fs)
Expand Down