eselect-metasploit: minor ebuild cleanup, minor speed improvement, stub out bundle-audit use in msfloader

This commit is contained in:
Rick Farina (Zero_Chaos) 2020-09-11 23:38:28 -04:00
parent b54acaecb1
commit 62cd67d446
No known key found for this signature in database
GPG key ID: A29433C0AA431DDC
2 changed files with 19 additions and 11 deletions

View file

@ -4,8 +4,6 @@
EAPI=7
inherit multilib
DESCRIPTION="eselect module for metasploit"
HOMEPAGE="http://www.pentoo.ch/"
SRC_URI=""
@ -16,6 +14,7 @@ KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
DEPEND="!<net-analyzer/metasploit-4.6"
#dev-ruby/bundler-audit needed if we uncomment the code in msfloader which uses it
RDEPEND="${DEPEND}
app-admin/eselect"

View file

@ -9,6 +9,13 @@ ruby="${header:2}"
if [ -f "/usr/lib/metasploit/Gemfile.lock" ]; then
GEMFILE=/usr/lib/metasploit/Gemfile
#printf "Checking for known vulnerabilities...\n"
#pushd /usr/lib/metasploit/ > /dev/zero
#if ! ${ruby} -S bundle-audit check -u; then
# printf "Known vulnerabilites have been found, please update metasploit.\n"
# printf "If you are up to date, please report an issue https://github.com/rapid7/metasploit-framework/issues\n"
#fi
#popd > /dev/zero
else
GEMFILE="~/.msf4/Gemfile"
@ -30,8 +37,6 @@ else
if ls -A /usr/lib/metasploit/*.gemspec > /dev/zero 2>&1; then
cp /usr/lib/metasploit/*.gemspec ~/.msf4/
fi
fi
#ensure Gemfile.lock is up to date
if ! BUNDLE_GEMFILE="${GEMFILE}" ${ruby} -S bundle check > /dev/null 2>&1; then
if [ -f "~/.msf4/Gemfile.lock" ]; then
@ -41,6 +46,10 @@ if ! BUNDLE_GEMFILE="${GEMFILE}" ${ruby} -S bundle check > /dev/null 2>&1; then
exit 1
fi
fi
#printf "Checking for known vulnerabilities...\n"
#${ruby} -S bundle-audit check -u
fi
#ready to go
BUNDLE_GEMFILE="${GEMFILE}" ${ruby} -S bundle exec /usr/lib/metasploit/$(basename $0) "$@"