From 3a69c4fbbc668771a1062a35b2f5262b88401530 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Mon, 17 May 2021 22:32:21 +0200 Subject: [PATCH 1/1] extrahd.cgi: Use new system methods Signed-off-by: Stefan Schantl --- html/cgi-bin/extrahd.cgi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index e277abd511..154efd7b28 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -103,7 +103,7 @@ END } elsif ($extrahdsettings{'ACTION'} eq $Lang::tr{'delete'}) { - if ( `/usr/local/bin/extrahdctrl umount $extrahdsettings{'PATH'}` ) { + if ( &General::system("/usr/local/bin/extrahdctrl", "umount", "$extrahdsettings{'PATH'}")) { open( FILE, "< $devicefile" ) or die "Unable to read $devicefile"; @tmp = ; close FILE; @@ -143,7 +143,11 @@ END { @deviceline = split( /\;/, $deviceentry ); my $color="$Header::colourred"; - if ( ! `/bin/mountpoint $deviceline[2] | grep " not "` ) { + + # Use safe system_output to get mountpoint details. + my @mountpoint = &General::system_output("/bin/mountpoint", "$deviceline[2]"); + + if ( ! grep(/not/, @mountpoint)) { $color=$Header::colourgreen; } print <