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:
parent
e220b24c5a
commit
a985096b50
@ -9,9 +9,9 @@
|
|||||||
|
|
||||||
exec >&2
|
exec >&2
|
||||||
set -eu
|
set -eu
|
||||||
|
MYNAME=$(basename $0)
|
||||||
|
|
||||||
if [[ $# != 4 ]]; then
|
if [[ $# != 4 ]]; then
|
||||||
MYNAME=$(basename $0)
|
|
||||||
echo "$MYNAME: expected 4 arguments, got $#"
|
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 allow_other"
|
||||||
echo "Example: $MYNAME /home/user.crypt /home/user.plain -o defaults"
|
echo "Example: $MYNAME /home/user.crypt /home/user.plain -o defaults"
|
||||||
@ -20,6 +20,12 @@ fi
|
|||||||
|
|
||||||
SRC=$1
|
SRC=$1
|
||||||
DST=$2
|
DST=$2
|
||||||
|
|
||||||
|
if mountpoint "$DST" > /dev/null; then
|
||||||
|
echo "$MYNAME: something is already mounted on $DST, refusing"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
GOPTS=""
|
GOPTS=""
|
||||||
for OPT in nonempty allow_other quiet; do
|
for OPT in nonempty allow_other quiet; do
|
||||||
if [[ $4 == *$OPT* ]]; then
|
if [[ $4 == *$OPT* ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user