[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#754170: fails to exclude RAID members



Package: os-prober
Version: 1.58

Hello,

the os-prober fails to exclude partittions that are members of md RAID, when
dash is installed as /bin/sh.

The parse_proc_mdstat() function fails to detect them. I found the bug to
lie in line:

                        dev="${word%%[*}"

dash fails to strip opening square bracke to the rest of the line.
Escaping it with backslash works with both bash and dash.
Here's the patch that fixes the behaviour:

--- os-prober.orig	2012-08-02 02:49:55.000000000 +0200
+++ os-prober	2014-07-08 12:46:41.173761806 +0200
@@ -81,7 +81,7 @@
 	fi
 	while read line; do
 		for word in $line; do
-			dev="${word%%[*}"
+			dev="${word%%\[*}"
 			# TODO: factor this out to something in di-utils if
 			# it's needed elsewhere
 			if [ -d /sys/block ] && type udevinfo >/dev/null 2>&1; then


-- 
Matus Uhlar
systemovy administrator

Slovanet, a.s.
tim produkcnych systemov
Zahradnicka 151, 821 08 Bratislava
Tel: +421 2 208 28 464
e-mail: matus.uhlar@slovanet.net
www.slovanet.sk


Reply to: