From 00cfc1fb3f121fe8ce237f936004b673fb1eac34 Mon Sep 17 00:00:00 2001 From: thomas Date: Thu, 16 Feb 2023 11:38:41 +0100 Subject: [PATCH] mxraid/mxraid_assemble: Fix smartctl callup Possible cause for the bug: smartctl_info was only tested when starting the code, later on the the switch from a simple device key to dev_list was forgotten in this function. --- mxraid/mxraid_assemble | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mxraid/mxraid_assemble b/mxraid/mxraid_assemble index 5256d2e..1ac07d0 100755 --- a/mxraid/mxraid_assemble +++ b/mxraid/mxraid_assemble @@ -735,7 +735,7 @@ exit; $serial_number =~ s/^\s+//; } else { if ($self->{root_priv}) { - $serial_number = smartctl_info($dev_list->[$i], 'Serial_Number'); + $serial_number = smartctl_info('/dev/'.$dk, 'Serial_Number'); } else { warn "# You must be root to query '$dk'.\n" if $self->{verbose} >= 1; } @@ -801,6 +801,7 @@ exit; if ($parse) { my ($key, $val) = $_ =~ m/^([^:]+):\s*(.+)$/; next unless defined $key and defined $val; + $key =~ s/\s+/_/g; $smart_data{$key} = $val; } }