Fixes #3470 by canonicalizing module paths as they are added

git-svn-id: file:///home/svn/framework3/trunk@11668 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Joshua Drake 2011-01-29 03:34:48 +00:00
parent 1ee9b205b8
commit 647b41cc96
1 changed files with 7 additions and 0 deletions

View File

@ -1,4 +1,5 @@
require 'msf/core'
require 'pathname'
module Msf
@ -603,6 +604,12 @@ class ModuleManager < ModuleSet
def add_module_path(path, check_cache = true)
path.sub!(/#{File::SEPARATOR}$/, '')
# Make the path completely canonical
path = File.expand_path(path)
path = Pathname.new(path).realpath.to_s
$stderr.puts "[*] Adding module path #{path.inspect} ..."
# Make sure the path is a valid directory before we try to rock the
# house
if (File.directory?(path) == false)