From patchwork Wed Aug 2 09:14:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 7061 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 4RG5rt6VkVz3wjw for ; Wed, 2 Aug 2023 09:14:22 +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) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RG5rq1PxGzSr; Wed, 2 Aug 2023 09:14:19 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RG5rq0kRfz309T; Wed, 2 Aug 2023 09:14:19 +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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4RG5rn6DfBz2xFy for ; Wed, 2 Aug 2023 09:14:17 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (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 "michael.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RG5rn16CHzSr; Wed, 2 Aug 2023 09:14:17 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4RG5rm4zVMzTgQ7; Wed, 2 Aug 2023 09:14:16 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 2/3] extrahd: Skip relative mountpoints Date: Wed, 2 Aug 2023 09:14:14 +0000 Message-Id: <20230802091415.3168597-2-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230802091415.3168597-1-michael.tremer@ipfire.org> References: <20230802091415.3168597-1-michael.tremer@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: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer --- config/extrahd/extrahd.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/extrahd/extrahd.pl b/config/extrahd/extrahd.pl index be91e27f6..eba3f9b37 100644 --- a/config/extrahd/extrahd.pl +++ b/config/extrahd/extrahd.pl @@ -40,6 +40,12 @@ extrahd_mount() { continue fi + # Check that the mountpoint starts with a slash + if [ "${mountpoint:0:1}" != "/" ]; then + log "Skipping invalid mountpoint: ${mountpoint}" + continue + fi + # Skip mounting if something is already mounted at the mountpoint if mountpoint "${mountpoint}" &>/dev/null; then continue