diff options
author | Werner Koch <[email protected]> | 2016-08-14 18:17:51 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2016-08-14 18:17:51 +0000 |
commit | b781113cf1391926dedf8dc943624d3bb9726318 (patch) | |
tree | 6a1d128f05bd2e18daea306602df026c2966c156 /g13/call-syshelp.c | |
parent | g13: Fix double free bug. (diff) | |
download | gnupg-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/call-syshelp.c')
-rw-r--r-- | g13/call-syshelp.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/g13/call-syshelp.c b/g13/call-syshelp.c index 952d8de77..76d181b67 100644 --- a/g13/call-syshelp.c +++ b/g13/call-syshelp.c @@ -522,6 +522,40 @@ call_syshelp_run_mount (ctrl_t ctrl, int conttype, const char *mountpoint, /* + * Run the UMOUNT command on the current device. CONTTYPES gives the + * content type of the container (fixme: Do we really need this?). + */ +gpg_error_t +call_syshelp_run_umount (ctrl_t ctrl, int conttype) +{ + gpg_error_t err; + assuan_context_t ctx; + + err = start_syshelp (ctrl, &ctx); + if (err) + goto leave; + + if (conttype == CONTTYPE_DM_CRYPT) + { + err = assuan_transact (ctx, "UMOUNT dm-crypt", + NULL, NULL, + NULL, NULL, + NULL, NULL); + } + else + { + log_error ("invalid backend type %d given\n", conttype); + err = GPG_ERR_INTERNAL; + goto leave; + } + + leave: + return err; +} + + + +/* * Run the SUSPEND command on the current device. CONTTYPES gives the * requested content type for the new container. */ |