]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdmon: Stop parsing duplicate options
authorLukasz Florczak <lukasz.florczak@linux.intel.com>
Fri, 13 May 2022 07:19:42 +0000 (09:19 +0200)
committerJes Sorensen <jsorensen@fb.com>
Thu, 9 Jun 2022 22:05:49 +0000 (18:05 -0400)
commit1066ab83dbe9a4cc20f7db44a40aa2cbb9d5eed6
tree8de8004b5ce74e825c9026cc9768a72c6dd9fb16
parent52c67fcdd6dadc4138ecad73e65599551804d445
mdmon: Stop parsing duplicate options

Introduce new function is_duplicate_opt() to check if given option
was already used and prevent setting it again along with an error
message.

Move parsing above in_initrd() check to be able to detect --offroot
option duplicates.

Now help option is executed after parsing to prevent executing commands
like: 'mdmon --help --ndlksnlksajndfjksndafasj'.

Signed-off-by: Lukasz Florczak <lukasz.florczak@linux.intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
mdmon.c