aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2009-04-10 02:18:27 +0800
committermarcus <marcus@FreeBSD.org>2009-04-10 02:18:27 +0800
commita6f0911c6ac1393f9dfb68740e6cbe044651d591 (patch)
tree1dfb5c84e0f8cbcfe54d56a082051c9b0e7c646e
parent46519d56498699110b21aef66cf3224f68e42322 (diff)
downloadfreebsd-ports-gnome-a6f0911c6ac1393f9dfb68740e6cbe044651d591.tar.gz
freebsd-ports-gnome-a6f0911c6ac1393f9dfb68740e6cbe044651d591.tar.zst
freebsd-ports-gnome-a6f0911c6ac1393f9dfb68740e6cbe044651d591.zip
Add some more argument sanity checking to the fuse helper script. This
fixes a problem where mounting NTFS volumes using ntfs-3g fails due to bad options. Submitted by: Kris Moore <kris@pcbsd.com>
-rw-r--r--sysutils/hal/Makefile2
-rw-r--r--sysutils/hal/files/mount-fuse32
2 files changed, 29 insertions, 5 deletions
diff --git a/sysutils/hal/Makefile b/sysutils/hal/Makefile
index 4baa4b8fa56f..0e1b42ce3397 100644
--- a/sysutils/hal/Makefile
+++ b/sysutils/hal/Makefile
@@ -8,7 +8,7 @@
PORTNAME= hal
DISTVERSION= 0.5.11
-PORTREVISION= 22
+PORTREVISION= 23
CATEGORIES= sysutils
MASTER_SITES= http://hal.freedesktop.org/releases/
diff --git a/sysutils/hal/files/mount-fuse b/sysutils/hal/files/mount-fuse
index ae906a8140d3..a0ea8536e3a5 100644
--- a/sysutils/hal/files/mount-fuse
+++ b/sysutils/hal/files/mount-fuse
@@ -18,6 +18,8 @@ MNTSTRING=""
OPTIONS=""
FOUNDOPT="0"
FOUNDU="0"
+FOUNDG="0"
+FOUNDBADARG="0"
HWDEV=""
FOUNDDEV="0"
@@ -29,6 +31,13 @@ do
elif [ "${FOUNDU}" = "1" ]
then
OPTIONS="${OPTIONS} -o uid=${i}"
+ elif [ "${FOUNDG}" = "1" ]
+ then
+ OPTIONS="${OPTIONS} -o gid=${i}"
+ elif [ "${FOUNDBADARG}" = "1" ]
+ then
+ # We have an invalid argument flag, so ignore it and following argument
+ FOUNDBADARG="0"
else
if [ "${FOUNDDEV}" = "1" ]
@@ -63,15 +72,15 @@ do
fi
fi
- # Add the value to our mount string
- if [ "${i}" != "-o" -a "${i}" != "-u" ]
+ # Add the value to our mount string if it isn't any invalid flag
+ if [ "${i}" != "-o" -a "${i}" != "-u" -a "${i}" != "-C" -a "${i}" != "-g" -a "${i}" != "-m" -a "${i}" != "-a" -a "${i}" != "-i" -a "${i}" -a "-W" ]
then
MNTSTRING="${MNTSTRING} ${i}"
fi
fi
- # Check if we are on a -u flag now
+ # Check if we are on a -u user id flag now
if [ "${i}" = "-u" ]
then
FOUNDU="1"
@@ -79,6 +88,14 @@ do
FOUNDU="0"
fi
+ # Check if we are on a -g group id flag now
+ if [ "${i}" = "-g" ]
+ then
+ FOUNDG="1"
+ else
+ FOUNDG="0"
+ fi
+
# Check if we are on a -o option
if [ "${i}" = "-o" ]
then
@@ -86,12 +103,19 @@ do
else
FOUNDOPT="0"
fi
+
+ # Check if we are on some other invalid flag
+ if [ "${i}" = "-C" -o "${i}" = "-m" -o "${i}" = "-W" ]
+ then
+ FOUNDBADARG="1"
+ else
+ FOUNDBADARG="0"
+ fi
done
# Save our final string which our FUSE helper will use
FINALSTRING="${MNTSTRING} ${OPTIONS}"
-
# Check that fuse.ko is loaded
kldstat | grep -q fuse 2>/dev/null
if [ "$?" != "0" ]