look for files in absolute paths. fixes #252

git-svn-id: file:///home/svn/framework3/trunk@5928 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2008-11-16 21:10:35 +00:00
parent 5d0ebc18cf
commit b3ecce5cf4
4 changed files with 9 additions and 9 deletions

View File

@ -33,7 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=end
module Rex
Root = File.join(File.dirname(__FILE__), 'rex')
Root = File.join(File.expand_path(File.dirname(__FILE__)), 'rex')
LogSource = "rex"
end
@ -98,4 +98,4 @@ Kernel.class_eval("
def select(rfd = nil, wfd = nil, efd = nil, to = nil)
Rex::ThreadSafe.select(rfd, wfd, efd, to)
end
")
")

View File

@ -140,7 +140,7 @@ class ClientCore < Extension
end
# Get us to the installation root and then into data/meterpreter, where
# the file is expected to be
path = File.join(File.dirname(__FILE__), '..', '..', '..', '..', 'data/meterpreter/ext_server_' + mod.downcase + '.dll')
path = ::File.join(Msf::Config.install_root, 'data', 'meterpreter', 'ext_server_' + mod.downcase + '.dll')
if (opts['ExtensionPath'])
path = opts['ExtensionPath']
@ -320,7 +320,7 @@ class ClientCore < Extension
wrote = client.sock.write(inject_lib)
# Transmit the size of the server
metsrv = File.join(File.dirname(__FILE__), '..', '..', '..', '..', "data", "meterpreter", "metsrv.dll")
metsrv = ::File.join(Msf::Config.install_root, "data", "meterpreter", "metsrv.dll")
buf = "metsrv.dll\x00"
::File.open(metsrv, 'rb') { |f|
@ -351,4 +351,4 @@ class ClientCore < Extension
end
end; end; end
end; end; end

View File

@ -5,7 +5,7 @@
#
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(File.join(File.expand_path(File.dirname(msfbase)), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
@ -81,4 +81,4 @@ begin
options
).run
rescue Interrupt
end
end

4
msfgui
View File

@ -4,7 +4,7 @@
#
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(File.join(File.expand_path(File.dirname(msfbase)), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
@ -106,4 +106,4 @@ $stderr.puts "[*] Debugging mode is enabled"
ENV['LANG'] = 'C'
# Create the driver instance and run it.
Msf::Ui::Gtk2::Driver.new(opts).run
Msf::Ui::Gtk2::Driver.new(opts).run