summaryrefslogtreecommitdiff
path: root/sys-apps/openrc/files/openrc-protect-rcsvcdir-for-symlink.patch
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/openrc/files/openrc-protect-rcsvcdir-for-symlink.patch')
-rw-r--r--sys-apps/openrc/files/openrc-protect-rcsvcdir-for-symlink.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys-apps/openrc/files/openrc-protect-rcsvcdir-for-symlink.patch b/sys-apps/openrc/files/openrc-protect-rcsvcdir-for-symlink.patch
new file mode 100644
index 00000000..a202aeac
--- /dev/null
+++ b/sys-apps/openrc/files/openrc-protect-rcsvcdir-for-symlink.patch
@@ -0,0 +1,30 @@
+diff -Naur a/openrc-0.6.0/init.d/localmount.in b/openrc-0.6.0/init.d/localmount.in
+--- a/openrc-0.6.0/init.d/localmount.in 2009-12-21 09:30:17.000000000 -0600
++++ b/openrc-0.6.0/init.d/localmount.in 2010-03-09 10:53:53.000000000 -0600
+@@ -32,6 +32,11 @@
+ # 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"
++
++ # In case $RC_SVCDIR tries to unmount due to lib64
++ # symlink configuration, we cd to it to lock it
++ cd "$RC_SVCDIR"
++
+ # RC_NO_UMOUNTS is an env var that can be set by plugins
+ OIFS=$IFS SIFS=${IFS-y}
+ IFS=$IFS:
+diff -Naur a/openrc-0.6.0/init.d/mount-ro.in b/openrc-0.6.0/init.d/mount-ro.in
+--- a/openrc-0.6.0/init.d/mount-ro.in 2009-12-21 09:30:17.000000000 -0600
++++ b/openrc-0.6.0/init.d/mount-ro.in 2010-03-09 10:56:25.000000000 -0600
+@@ -16,6 +16,11 @@
+ sync; sync
+
+ ebegin "Remounting remaining filesystems read-only"
++
++ # cd to $RC_SVCDIR it to lock it in case of incorrect
++ # assumptions about lib64 symlink configuration.
++ cd "$RC_SVCDIR"
++
+ # We need the do_unmount function
+ . "$RC_LIBEXECDIR"/sh/rc-mount.sh
+ eindent