This will avoid problmes with symlinks as well as paths containing ./, ../ or trailing slashes. --- src/PVE/ProcFSTools.pm | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm index 4670694..368ae73 100644 --- a/src/PVE/ProcFSTools.pm +++ b/src/PVE/ProcFSTools.pm @@ -6,6 +6,7 @@ use POSIX; use Time::HiRes qw (gettimeofday); use IO::File; use PVE::Tools; +use Cwd; my $clock_ticks = POSIX::sysconf(&POSIX::_SC_CLK_TCK); @@ -291,6 +292,8 @@ sub read_proc_mounts { sub is_mounted { my ($mountpoint) = @_; + $mountpoint = Cwd::realpath($mountpoint); + my $mountdata = read_proc_mounts(); if ($mountdata =~ m/\s$mountpoint\s/) { -- 2.1.4 _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel