]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
extrahd.cgi: Do not allow "/mnt" or "/media" as mount points
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 1 Aug 2023 15:48:38 +0000 (17:48 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Aug 2023 09:11:57 +0000 (09:11 +0000)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/extrahd.cgi

index 122f1d12d722bc13790f5f9d55c5673eb8db9c0f..bd64dff0700cef1e64700c8f54907e020659f3dd 100644 (file)
@@ -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);