dcavalca / rpms / initscripts

Forked from rpms/initscripts 4 years ago
Clone

Blame SOURCES/0001-fedora-readonly-fix-prefix-detection-1059749.patch

465f7f
From bdfa5a5d4e959937fe9f525d8ce39cec410dbe08 Mon Sep 17 00:00:00 2001
465f7f
From: =?UTF-8?q?V=C3=A1clav=20Pavl=C3=ADn?= <vpavlin@redhat.com>
465f7f
Date: Wed, 16 Apr 2014 13:47:53 +0200
465f7f
Subject: [PATCH] fedora-readonly: fix prefix detection (#1059749)
465f7f
465f7f
---
465f7f
 systemd/rhel-readonly | 5 +++--
465f7f
 1 file changed, 3 insertions(+), 2 deletions(-)
465f7f
465f7f
diff --git a/systemd/rhel-readonly b/systemd/rhel-readonly
465f7f
index 190de26..f33eef4 100755
465f7f
--- a/systemd/rhel-readonly
465f7f
+++ b/systemd/rhel-readonly
465f7f
@@ -42,7 +42,8 @@ MOUNTS=()
465f7f
 if [ "$READONLY" = "yes" -o "$TEMPORARY_STATE" = "yes" ]; then
465f7f
 
465f7f
         add_mount() {
465f7f
-                MOUNTS=("${MOUNTS[@]}" "$1")
465f7f
+                mnt=${1%/}
465f7f
+                MOUNTS=("${MOUNTS[@]}" "$mnt")
465f7f
         }
465f7f
 
465f7f
         cp_empty() {
465f7f
@@ -109,7 +110,7 @@ if [ "$READONLY" = "yes" -o "$TEMPORARY_STATE" = "yes" ]; then
465f7f
                 prefix=0
465f7f
                 for mount_point in "${MOUNTS[@]}"; do
465f7f
                         [[ $m = $mount_point ]] && continue
465f7f
-                        if [[ $m =~ ^$mount_point.* ]] ; then
465f7f
+                        if [[ $m =~ ^$mount_point/.* ]] ; then
465f7f
                                 prefix=1
465f7f
                                 break
465f7f
                         fi
465f7f
-- 
465f7f
1.8.3.1
465f7f