]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
extrahd.cgi: Fix broken UUID check
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 12 Sep 2023 18:20:00 +0000 (20:20 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 13 Sep 2023 09:28:25 +0000 (09:28 +0000)
This check was totaly broken and resulted into not beeing able to
configure/mount more than one extra harddrive.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/extrahd.cgi

index 9cdfc69f8287f66dcd88309993c93ced1b593d17..c3a14c9e4bc33b08a1b820dec194b625a8ff6500 100644 (file)
@@ -113,13 +113,16 @@ if ($extrahdsettings{'ACTION'} eq $Lang::tr{'add'}) {
                        # Split the line into pieces and assign nice variables.
                        my ($uuid, $fs, $path) = split( /\;/, $entry );
 
+                       # Remove tailing UUID= from uuid string.
+                       $uuid =~ s{^UUID=}{};
+
                        # Check if the path is allready used.
                        if ( "$extrahdsettings{'PATH'}" eq "$path" ) {
                                $errormessage = "$Lang::tr{'extrahd you cant mount'} $extrahdsettings{'DEVICE'} $Lang::tr{'extrahd to'} $extrahdsettings{'PATH'} $Lang::tr{'extrahd because there is already a device mounted'}.";
                        }
 
                        # Check if the uuid is allready used.
-                       if ("$extrahdsettings{'DEVICE'} eq $uuid") {
+                       if ("$extrahdsettings{'UUID'}" eq "$uuid") {
                                $errormessage = "$extrahdsettings{'DEVICE'} is allready mounted.";
                        }
                }