summaryrefslogtreecommitdiff
path: root/init.d/localmount.in
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2011-09-11 15:12:54 +0200
committerChristian Ruppert <idl0r@gentoo.org>2011-09-11 18:51:29 +0200
commit2d180551ef5f2541e22a5eaf90b4efc7aadba914 (patch)
tree30a1d7e7da3137e2d75df78ea09f95dc73d82bdb /init.d/localmount.in
parenta9738a85085773bb5047466a98044cf06513b49e (diff)
downloadopenrc-2d180551ef5f2541e22a5eaf90b4efc7aadba914.tar.gz
openrc-2d180551ef5f2541e22a5eaf90b4efc7aadba914.tar.bz2
openrc-2d180551ef5f2541e22a5eaf90b4efc7aadba914.tar.xz
Fix regex pattern for umounts during shutdown
This patch fixes the regex pattern for /lib -> /lib(32|64)? as well as the pattern for RC_SVCDIR if it contains /lib(32|64)?/. This fixes bug 381783. X-Gentoo-Bug: 381783 X-Gentoo-Bug-URL: https://bugs.gentoo.org/381783
Diffstat (limited to 'init.d/localmount.in')
-rw-r--r--init.d/localmount.in10
1 files changed, 7 insertions, 3 deletions
diff --git a/init.d/localmount.in b/init.d/localmount.in
index 166ee77..3fbc071 100644
--- a/init.d/localmount.in
+++ b/init.d/localmount.in
@@ -34,8 +34,12 @@ start()
stop()
{
# We never unmount / or /dev or $RC_SVCDIR
- local x= no_umounts_r="/|/dev|/dev/.*|${RC_SVCDIR}"
- no_umounts_r="${no_umounts_r}|/bin|/sbin|/lib|/libexec"
+
+ # Bug 381783
+ local rc_svcdir=$(echo $RC_SVCDIR | sed 's:/lib\(32\|64\)\?/:/lib(32|64)?/:g')
+
+ local x= no_umounts_r="/|/dev|/dev/.*|${rc_svcdir}"
+ no_umounts_r="${no_umounts_r}|/bin|/sbin|/lib(32|64)?|/libexec"
# RC_NO_UMOUNTS is an env var that can be set by plugins
local IFS="$IFS:"
for x in $no_umounts $RC_NO_UMOUNTS; do
@@ -69,7 +73,7 @@ stop()
done
[ -n "$fs" ] && fs="^($fs)$"
do_unmount umount --skip-point-regex "$no_umounts_r" \
- ${fs:+--skip-fstype-regex} $fs --nonetdev
+ "${fs:+--skip-fstype-regex}" $fs --nonetdev
eoutdent
return 0