mdcheck: be careful when sourcing the output of "mdadm --detail --export"
The output of "mdadm --detail --export" isn't quoted properly so fields that contain spaces can be a problem. We only want the MD_UUID field, and it has a very well defined format with no spaces. So use 'grep' to limit the output to just that. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
71e5411eea
commit
979b1feb09
|
@ -88,7 +88,7 @@ do
|
|||
continue
|
||||
fi
|
||||
|
||||
mdadm --detail --export "$dev" > $tmp || continue
|
||||
mdadm --detail --export "$dev" | grep '^MD_UUID=' > $tmp || continue
|
||||
source $tmp
|
||||
fl="/var/lib/mdcheck/MD_UUID_$MD_UUID"
|
||||
if [ -z "$cont" ]
|
||||
|
|
Loading…
Reference in New Issue