summaryrefslogtreecommitdiff
path: root/contrib/pam_mount
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-10-09 00:32:49 +0200
committerJakob Unterwurzacher2016-10-09 00:32:49 +0200
commita985096b50666172425610a66cbfa0997a23db6e (patch)
tree6c024d725efc78e7e14c4836bfb0f7bee5bf537f /contrib/pam_mount
parente220b24c5a2117eaec9882ee8d149faba6120731 (diff)
contrib: pam_mount: check if something is already mounted on DST
pam_mount is supposed to check that as well, but it seems to get confused by the "command#path" syntax used for FUSE. Let's do it here.
Diffstat (limited to 'contrib/pam_mount')
-rwxr-xr-xcontrib/pam_mount/gocryptfs_pam_mount.bash8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/pam_mount/gocryptfs_pam_mount.bash b/contrib/pam_mount/gocryptfs_pam_mount.bash
index 3c7e48d..e6f31ba 100755
--- a/contrib/pam_mount/gocryptfs_pam_mount.bash
+++ b/contrib/pam_mount/gocryptfs_pam_mount.bash
@@ -9,9 +9,9 @@
exec >&2
set -eu
+MYNAME=$(basename $0)
if [[ $# != 4 ]]; then
- MYNAME=$(basename $0)
echo "$MYNAME: expected 4 arguments, got $#"
echo "Example: $MYNAME /home/user.crypt /home/user.plain -o allow_other"
echo "Example: $MYNAME /home/user.crypt /home/user.plain -o defaults"
@@ -20,6 +20,12 @@ fi
SRC=$1
DST=$2
+
+if mountpoint "$DST" > /dev/null; then
+ echo "$MYNAME: something is already mounted on $DST, refusing"
+ exit 2
+fi
+
GOPTS=""
for OPT in nonempty allow_other quiet; do
if [[ $4 == *$OPT* ]]; then