Skip to content

Commit 7006122

Browse files
author
HD Moore
committed
The use of to_path fails on OS X, switch to to_s
1 parent 874fe64 commit 7006122

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/msf/core/module_manager/module_paths.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def add_module_path(path)
2525
raise RuntimeError, "The path supplied does not exist", caller
2626
end
2727

28-
nested_paths << pathname.expand_path.to_path
28+
nested_paths << pathname.expand_path.to_s
2929
else
3030
# Make the path completely canonical
3131
pathname = Pathname.new(path).expand_path
@@ -35,7 +35,7 @@ def add_module_path(path)
3535
raise RuntimeError, "The path supplied is not a valid directory.", caller
3636
end
3737

38-
nested_paths << pathname.to_path
38+
nested_paths << pathname.to_s
3939

4040
# Identify any fastlib archives inside of this path
4141
fastlib_glob = pathname.join('**', "*#{Msf::Modules::Loader::Archive::ARCHIVE_EXTENSION}")
@@ -74,4 +74,4 @@ def remove_module_path(path)
7474
protected
7575

7676
attr_accessor :module_paths # :nodoc:
77-
end
77+
end

lib/msf/core/modules/loader/directory.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def each_module_reference_name(path)
4444
if module_path?(entry_descendant_path)
4545
entry_descendant_pathname = Pathname.new(entry_descendant_path)
4646
relative_entry_descendant_pathname = entry_descendant_pathname.relative_path_from(full_entry_pathname)
47-
relative_entry_descendant_path = relative_entry_descendant_pathname.to_path
47+
relative_entry_descendant_path = relative_entry_descendant_pathname.to_s
4848

4949
# The module_reference_name doesn't have a file extension
5050
module_reference_name = module_reference_name_from_path(relative_entry_descendant_path)
@@ -75,4 +75,4 @@ def read_module_content(parent_path, type, module_reference_name)
7575

7676
::File.read(full_path)
7777
end
78-
end
78+
end

0 commit comments

Comments
 (0)