#816406 mdadm mkconf doesn't parse mdadm.conf correctly(whitespace)

Package:
mdadm
Source:
mdadm
Description:
Tool to administer Linux MD arrays (software RAID)
Submitter:
Adam Heath
Date:
2023-03-01 06:30:05 UTC
Severity:
minor
#816406#5
Date:
2016-03-01 17:01:19 UTC
From:
To:
/usr/share/mdadm/mkconf attemps to read DEVICE out of
/etc/mdadm/mdadm.conf, using sed.  It does this, with a simple regex,
"s/^DEVICE //p". This is not valid.  mdadm.conf(5) says you can have any
whitespace after it(space, tab, even newline).  The first sentence of
the SYNTAX section, says it's a series of words separated by whitespace.

#816406#10
Date:
2020-09-13 04:46:38 UTC
From:
To:
Hi Adam,

Doesn't mkconf merely transfer the value? I think the code works as
expected. It may not work for other whitespace, as you point out. For
multiple spaces, the field value is also not trimmed, but mkconf does
not run repeatedly. Either way, I do not think there is a need for
mkconf to parse the value the way you describe.

Do you have a problem as a result of the code, or are you making an
academic point? Thanks for helping to make mdadm better for everyone!

Kind regards
Felix Lechner