aboutsummaryrefslogtreecommitdiffstats
path: root/g13/be-dmcrypt.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-08-14 18:17:51 +0000
committerWerner Koch <[email protected]>2016-08-14 18:17:51 +0000
commitb781113cf1391926dedf8dc943624d3bb9726318 (patch)
tree6a1d128f05bd2e18daea306602df026c2966c156 /g13/be-dmcrypt.c
parentg13: Fix double free bug. (diff)
downloadgnupg-b781113cf1391926dedf8dc943624d3bb9726318.tar.gz
gnupg-b781113cf1391926dedf8dc943624d3bb9726318.zip
g13: Implement --umount for dm-crypt.
* g13/g13.c (main): Implement command --umount. * g13/mount.c (g13_umount_container): use the syshelper if needed. * g13/backend.c (be_umount_container): New. * g13/be-dmcrypt.c (be_dmcrypt_umount_container): New. * g13/call-syshelp.c (call_syshelp_run_umount): New. * g13/sh-cmd.c (cmd_umount): New. (register_commands): Register UMOUNT. * g13/sh-dmcrypt.c (sh_dmcrypt_umount_container): New. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g13/be-dmcrypt.c')
-rw-r--r--g13/be-dmcrypt.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/g13/be-dmcrypt.c b/g13/be-dmcrypt.c
index e5e9b332a..c65be0894 100644
--- a/g13/be-dmcrypt.c
+++ b/g13/be-dmcrypt.c
@@ -64,6 +64,23 @@ be_dmcrypt_mount_container (ctrl_t ctrl,
}
+/* Unmount the container described by the filename FNAME. */
+gpg_error_t
+be_dmcrypt_umount_container (ctrl_t ctrl, const char *fname)
+{
+ gpg_error_t err;
+
+ err = call_syshelp_set_device (ctrl, fname);
+ if (err)
+ goto leave;
+
+ err = call_syshelp_run_umount (ctrl, CONTTYPE_DM_CRYPT);
+
+ leave:
+ return err;
+}
+
+
/* Suspend the container described by the filename FNAME. */
gpg_error_t
be_dmcrypt_suspend_container (ctrl_t ctrl, const char *fname)