From patchwork Tue Sep 12 18:20:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 7163 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RlX1p0S48z3wlj for ; Tue, 12 Sep 2023 18:20:14 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RlX1m0kVczfX; Tue, 12 Sep 2023 18:20:12 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RlX1l73Ccz2y0C; Tue, 12 Sep 2023 18:20:11 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4RlX1k6DzNz2xYv for ; Tue, 12 Sep 2023 18:20:10 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4RlX1j6Mt7zM6; Tue, 12 Sep 2023 18:20:09 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1694542810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Xwd8HEUY4fsuHYGenQRTvuTyj61ln10zeC87g8XvGos=; b=XzEtjDQ0AHghSYzjMsLHsHIE3Tcflp7fSgYx/24FIo7ZqLIYG1EJMOa5uwTcTjZcPc1uel zorTk2KWnX+FaPAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1694542810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Xwd8HEUY4fsuHYGenQRTvuTyj61ln10zeC87g8XvGos=; b=DzqfaV2QqmZ3UZTlXYqCU/lc4gpkHeY7sDLzznfJaJ2qHTku40ZHHl3Gch1+/GPrmqURtg xcDlYEQZehWM9K1OXJndiLJxT/D8ecY3uvmRDXnTXQBFdb1a+p5OlP8gNIifhaLqEkuwjs m21VUGo96HAg7MJAe3GG0e12qD+vqNfdkYhuOLEjwSwrohxkw9YbdxKVocN15H0mhALAOX L5dbH2Iaob2zfIhYhtDmq4WvXws4sqQwi5YDmLBvXcOuOxpZ+OCCBqJTu7QmtAn37Eobaq 2qlkpecrQ78GFn9tfhKjBYjEYqU81Gl84AHaDttTV5hfRNuf5l8kVl2HZHC8Qg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] extrahd.cgi: Fix broken UUID check Date: Tue, 12 Sep 2023 20:20:00 +0200 Message-Id: <20230912182000.4937-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" This check was totaly broken and resulted into not beeing able to configure/mount more than one extra harddrive. Signed-off-by: Stefan Schantl --- html/cgi-bin/extrahd.cgi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index 9cdfc69f8..c3a14c9e4 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -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."; } }