Patch from Jonathan Steel to fix double-symlinks

git-svn-id: file:///home/svn/framework3/trunk@6203 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-01-30 06:27:10 +00:00
parent e6ef0ab495
commit beb0cc7cb3
13 changed files with 66 additions and 14 deletions

6
msfcli
View File

@ -5,7 +5,11 @@
# or web-based interface.
#
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']

View File

@ -4,7 +4,11 @@
# framework.
#
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.expand_path(File.dirname(msfbase)), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']

6
msfd
View File

@ -6,7 +6,11 @@
# possible for sessions to to be shared from a single vantage point.
#
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']

View File

@ -2,7 +2,11 @@
# $Id$
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']

View File

@ -1,6 +1,10 @@
#!/usr/bin/env ruby
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']

6
msfgui
View File

@ -3,7 +3,11 @@
# This is a basic user interface using the Gtk2 GUI library
#
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.expand_path(File.dirname(msfbase)), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']

View File

@ -1,6 +1,10 @@
#!/usr/bin/env ruby
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']

View File

@ -5,7 +5,11 @@
# and to display information about modules.
#
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']

View File

@ -1,6 +1,10 @@
#!/usr/bin/env ruby
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']

View File

@ -1,6 +1,10 @@
#!/usr/bin/env ruby
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']

6
msfrpc
View File

@ -4,7 +4,11 @@
# instance through a XMLRPC socket.
#
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']

View File

@ -4,7 +4,11 @@
# it with an XMLRPC interface to the Metasploit Framework.
#
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']

6
msfweb
View File

@ -3,7 +3,11 @@
# This user interface provides users with a web-based interface to the framework
#
msfbase = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.join(File.dirname(msfbase), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']