aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2007-01-13 18:47:24 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2007-01-13 18:47:24 +0000
commit7dcdf1bf5b4c9fe36bf6fdf98149154a3216f059 (patch)
tree7a50b2713c503a19fa6da1e058a1acd67e2b16b8
parent8ed044b4bf113117357f49661596980ac95b1103 (diff)
Fix option parsing in mount.fuse
-rw-r--r--ChangeLog4
-rw-r--r--util/mount.fuse16
2 files changed, 17 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 26f809c..350e575 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-01-13 Miklos Szeredi <miklos@szeredi.hu>
+
+ * Fix option parsing in mount.fuse. Patch from Jens M. Noedler
+
2006-12-16 Miklos Szeredi <miklos@szeredi.hu>
* kernel: don't keep unreferenced inodes in the icache.
diff --git a/util/mount.fuse b/util/mount.fuse
index 2a74449..1d87d1f 100644
--- a/util/mount.fuse
+++ b/util/mount.fuse
@@ -6,7 +6,7 @@
# to kick me to the right way
#
-VERSION="0.0.1"
+VERSION="0.0.2"
PRGNAME=`basename $0`
if [ -z "$HOME" ]; then
@@ -47,9 +47,19 @@ shift
eval `echo $@ | sed -n "s/\([^,]*,\)*setuid=\([^,]*\).*/SETUID=\2/p"`
-ignore_opts='\(user\|nouser\|users\|auto\|noauto\|_netdev\|setuid=[^,]*\)'
+ignore_opts='\(-o\|user\|nouser\|users\|auto\|noauto\|_netdev\|setuid=[^,]*\)'
-OPTIONS=`echo $@ | sed "s/,${ignore_opts}\|${ignore_opts},//g"`
+# loop over each mount option and skip all that should be ignored
+IFS=","
+for OPT in $@; do
+ OPT=`echo $OPT | sed "s/^$ignore_opts$/IGNORE/"`
+ if [ "$OPT" == "IGNORE" ]; then continue; fi
+ OPTIONS="$OPTIONS$OPT,"
+done
+IFS=" "
+
+# add "-o " and remove trailing comma
+OPTIONS="-o `echo $OPTIONS | sed "s/,$//"`"
if test -z "$SETUID"; then
${FSTYPE} ${MOUNTPATH} ${MOUNTPOINT} ${OPTIONS}