aboutsummaryrefslogtreecommitdiffstats
path: root/g13/backend.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/backend.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/backend.c')
-rw-r--r--g13/backend.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/g13/backend.c b/g13/backend.c
index dd2176834..659c6b749 100644
--- a/g13/backend.c
+++ b/g13/backend.c
@@ -240,6 +240,24 @@ be_mount_container (ctrl_t ctrl, int conttype,
}
+/* Dispatcher to the backend's umount function. */
+gpg_error_t
+be_umount_container (ctrl_t ctrl, int conttype, const char *fname)
+{
+ switch (conttype)
+ {
+ case CONTTYPE_ENCFS:
+ return gpg_error (GPG_ERR_NOT_SUPPORTED);
+
+ case CONTTYPE_DM_CRYPT:
+ return be_dmcrypt_umount_container (ctrl, fname);
+
+ default:
+ return no_such_backend (conttype);
+ }
+}
+
+
/* Dispatcher to the backend's suspend function. */
gpg_error_t
be_suspend_container (ctrl_t ctrl, int conttype, const char *fname)