diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2007-01-13 18:47:24 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2007-01-13 18:47:24 +0000 |
commit | 7dcdf1bf5b4c9fe36bf6fdf98149154a3216f059 (patch) | |
tree | 7a50b2713c503a19fa6da1e058a1acd67e2b16b8 /util | |
parent | 8ed044b4bf113117357f49661596980ac95b1103 (diff) |
Fix option parsing in mount.fuse
Diffstat (limited to 'util')
-rw-r--r-- | util/mount.fuse | 16 |
1 files changed, 13 insertions, 3 deletions
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} |