From a9b4c685d72ed6a96522348331d1cc177ecea00d Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Mon, 10 Jul 2023 21:26:47 +0200 Subject: [PATCH] extrahd.cgi: Do not allow "/mnt" or "/media" as mount points Signed-off-by: Stefan Schantl --- html/cgi-bin/extrahd.cgi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index 122f1d12d7..bd64dff070 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -667,6 +667,10 @@ sub is_mounted ($) { sub is_valid_dir ($) { my ($mpoint) = @_; + # Do not allow "/mnt" or "/media" as mount points. + return if($mpoint eq "/mnt"); + return if($mpoint eq "/media"); + # Split the given mountpoint into pieces and store them # in a temporay array. my @tmp = split("/", $mpoint); -- 2.39.5