Skip to content

Commit

Permalink
contrib: pam_mount: check if something is already mounted on DST
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rfjakob committed Oct 8, 2016
1 parent e220b24 commit a985096
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion contrib/pam_mount/gocryptfs_pam_mount.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit a985096

Please sign in to comment.