From 7dcdf1bf5b4c9fe36bf6fdf98149154a3216f059 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Sat, 13 Jan 2007 18:47:24 +0000 Subject: Fix option parsing in mount.fuse --- util/mount.fuse | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'util') 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} -- cgit v1.2.3