]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
extrahd.cgi: Do not allow "/mnt" or "/media" as mount points
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 10 Jul 2023 19:26:47 +0000 (21:26 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Mon, 10 Jul 2023 19:26:47 +0000 (21:26 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@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);