- nfs.init: improve handling of paths with spaces.

If a path name has a space, it will appear as \040
  in fstab and in /proc/mounts.  Using 'grep -E' to search
  for this is problematic as it will interpret the
  '\'.  So use 'grep -F' instead - we know there is
  only a single space in /proc/mounts.  Also use
  "read -r" so 'read' doesn't interpret the '/'.
  (bnc#666128)

OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=39
This commit is contained in:
Neil Brown 2011-02-16 23:59:03 +00:00 committed by Git OBS Bridge
parent 5851cf522d
commit cc1abc1879
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Wed Feb 16 23:55:22 UTC 2011 - nfbrown@novell.com
- nfs.init: improve handling of paths with spaces.
If a path name has a space, it will appear as \040
in fstab and in /proc/mounts. Using 'grep -E' to search
for this is problematic as it will interpret the
'\'. So use 'grep -F' instead - we know there is
only a single space in /proc/mounts. Also use
"read -r" so 'read' doesn't interpret the '/'.
(bnc#666128)
-------------------------------------------------------------------
Wed Feb 16 23:49:40 UTC 2011 - nfbrown@novell.com

View File

@ -43,7 +43,7 @@ if [ "x$nfs" != "xyes" ]
then nfs=no
fi
while read what where type options rest ; do
while read -r what where type options rest ; do
case "$what" in
\#*|"") continue ;;
esac
@ -56,7 +56,7 @@ while read what where type options rest ; do
esac
nfs=yes
if test "$1" = status ; then
grep -qE "^$what[[:blank:]]+$where[[:blank:]]+nfs" /proc/mounts && continue
grep -qF "$what $where nfs" /proc/mounts && continue
state=3
continue
fi