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.
This commit is contained in:
Jakob Unterwurzacher 2016-10-09 00:32:49 +02:00
parent e220b24c5a
commit a985096b50

View File

@ -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