summaryrefslogtreecommitdiffstats
path: root/g13
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-08-14 20:23:12 +0200
committerWerner Koch <wk@gnupg.org>2016-08-14 20:23:12 +0200
commitf02ceb6c6e94c6fbfaeeafe728397be38107de4d (patch)
tree55f3470fd82a00c547f28c53c994b8c309348b6c /g13
parentg13: Implement --umount for dm-crypt. (diff)
downloadgnupg2-f02ceb6c6e94c6fbfaeeafe728397be38107de4d.tar.xz
gnupg2-f02ceb6c6e94c6fbfaeeafe728397be38107de4d.zip
g13: Allow the use of a g13tab label for --mount.
* g13/mount.c (g13_mount_container): Do not run the first access check if syshelp is required. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g13')
-rw-r--r--g13/mount.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/g13/mount.c b/g13/mount.c
index f4371cce5..b46c8d0a0 100644
--- a/g13/mount.c
+++ b/g13/mount.c
@@ -60,10 +60,6 @@ g13_mount_container (ctrl_t ctrl, const char *filename, const char *mountpoint)
char *mountpoint_buffer = NULL;
char *blockdev_buffer = NULL;
- /* A quick check to see whether the container exists. */
- if (access (filename, F_OK))
- return gpg_error_from_syserror ();
-
/* Decide whether we need to use the g13-syshelp. */
err = call_syshelp_find_device (ctrl, filename, &blockdev_buffer);
if (!err)
@@ -77,6 +73,12 @@ g13_mount_container (ctrl_t ctrl, const char *filename, const char *mountpoint)
filename, gpg_strerror (err), gpg_strsource (err));
return err;
}
+ else
+ {
+ /* A quick check to see whether we can the container exists. */
+ if (access (filename, R_OK))
+ return gpg_error_from_syserror ();
+ }
if (!mountpoint)
{