-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Avoid manual handling of loop devices #533
Commits on Aug 5, 2024
-
Avoid manual handling of loop devices
Cryptsetup is since 1.3.0 capable of setting up a loop device if the device argument is a file. This has the additional benefit that those loop devices will get the AUTOCLEAR flag (available with Linux 2.6.25). This means those loop devices will be closed as soon they're unused (on luksClose).
Configuration menu - View commit details
-
Copy full SHA for bd79dbe - Browse repository at this point
Copy the full SHA bd79dbeView commit details
Commits on Aug 6, 2024
-
umount_tomb: avoid double execution of list_tomb_binds()
Especially directly after each other.
Configuration menu - View commit details
-
Copy full SHA for 18830a6 - Browse repository at this point
Copy the full SHA 18830a6View commit details -
list_tomb_mounts: simplify the function
previously it had dedicated cases for listing all tombs and a singular one, which duplicated code. The function got reworked, that it uses a different approach for findmnt. Instead of filtering the general result, it now uses --source on the tomb specific crypsetup mapper. Those are searched via general globbing of the devices in /dev/mapper. This allows to combine the previous separate cases. Additionally remove the usage of _sudo for findmnt, as it is not necessary.
Configuration menu - View commit details
-
Copy full SHA for 252cb30 - Browse repository at this point
Copy the full SHA 252cb30View commit details -
list_tomb_binds: simplify function
similar to list_tomb_mounts, rework the findmnt usage to usage of the actual tomb mapper device. Simplifies the awk usage and just only one argument needed for the mapper function.
Configuration menu - View commit details
-
Copy full SHA for 68970ef - Browse repository at this point
Copy the full SHA 68970efView commit details -
rework handling of bind mounts
Instead of only looking for bind mounts from within a tomb due to bind-hooks, also consider bind mounts that happenfrom the outside (example: open a tomb and manually issue a mount --bind /media/tomb some/other/location). Such a mount wouldn't be filtered before (only looking for an additional [/path/] added to TARGET. Instead look for every mount that is related to the respective /dev/mapper/ entry of a tomb and also close or list them. This helps to avoid to loop again against mounted tombs inside the main loop which loops over mounted tombs.
Configuration menu - View commit details
-
Copy full SHA for ca1674b - Browse repository at this point
Copy the full SHA ca1674bView commit details -
slam_tomb: adjust for changes in list_tomb_mounts
As the argument for list_tomb_mounts uses the input directly, it needs to be uniform. Therefore one must make sure that extraneous character like parentheses are removed from the variable. And those are in place in tombname for slam_tomb().
Configuration menu - View commit details
-
Copy full SHA for f207c9b - Browse repository at this point
Copy the full SHA f207c9bView commit details
Commits on Aug 7, 2024
-
tests: add outside bind mounts to 75_hooks
it may happen, that someone bind mounts manually or via an immutable setup the tomb mountdir somewhere else. Tomb should be able to discover such mounts and close them if the tomb itself is closed.
Configuration menu - View commit details
-
Copy full SHA for 5133d68 - Browse repository at this point
Copy the full SHA 5133d68View commit details