From cf770f3ada77cf35e1b620187fb7529dbb84acc6 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 8 Jul 2026 19:51:52 +0200 Subject: metasploit-framework-bin: apply SBo reviewer fixes, add man pages Christoph Willing's review changes: - generate /usr/bin launcher symlinks in the SlackBuild and let makepkg build doinst.sh per-arch, instead of shipping a preloaded doinst.sh. The preloaded doinst.sh was baked from an x86_64 build; on i386 its symlink targets did not exist, leaving a stray symlink in / on install. - cat msfvenom.bash-completion and README.SLACKWARE into place instead of cp -a, avoiding inserting files with a non-root uid/gid. Also: - ship msfconsole.1 and msfvenom.1 man pages from kali (the .deb ships none of its own), gzipped into /usr/man/man1. - note in README.SLACKWARE that the completion is a snapshot matching the shipped MSF version, and that the man pages come from kali. - document in CLAUDE.md how to regenerate the completion and refresh the man pages on version bumps. Co-Authored-By: Claude Opus 4.8 --- .../metasploit-framework-bin.SlackBuild | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'metasploit-framework-bin/metasploit-framework-bin.SlackBuild') diff --git a/metasploit-framework-bin/metasploit-framework-bin.SlackBuild b/metasploit-framework-bin/metasploit-framework-bin.SlackBuild index ae81cb2..41d7df0 100644 --- a/metasploit-framework-bin/metasploit-framework-bin.SlackBuild +++ b/metasploit-framework-bin/metasploit-framework-bin.SlackBuild @@ -72,9 +72,6 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -# create soft link for launcher -mkdir -p $PKG/usr/bin - # make bundled payload/exploit ELFs executable (see README) find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs -r chmod 755 @@ -82,18 +79,31 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +# create /usr/bin launcher symlinks; let makepkg build doinst.sh per-arch +mkdir -p $PKG/usr/bin +( cd $PKG/usr/bin && \ + for exe in ../../opt/$SRCNAM/bin/* ; do + ln -s $exe + done +) + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a $PKG/opt/$SRCNAM/LICENSE $PKG/usr/doc/$PRGNAM-$VERSION cp -a $PKG/opt/$SRCNAM/embedded/framework/README.md $PKG/usr/doc/$PRGNAM-$VERSION -cp -a $CWD/msfvenom.bash-completion $PKG/usr/doc/$PRGNAM-$VERSION -cp -a $CWD/README.SLACKWARE $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/msfvenom.bash-completion > $PKG/usr/doc/$PRGNAM-$VERSION/msfvenom.bash-completion +cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE + +# man pages (maintained by kali, updated per version bump) +mkdir -p $PKG/usr/man/man1 +for page in msfconsole msfvenom ; do + cat $CWD/$page.1 | gzip -9c > $PKG/usr/man/man1/$page.1.gz +done rm -rf $PKG/usr/share/doc cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc -cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE -- cgit v1.2.3