diff options
-rw-r--r-- | network/smb4k/README | 3 | ||||
-rw-r--r-- | network/smb4k/doinst.sh | 30 | ||||
-rw-r--r-- | network/smb4k/find_mount_umount.patch | 366 | ||||
-rw-r--r-- | network/smb4k/slack-desc | 19 | ||||
-rw-r--r-- | network/smb4k/smb4k.SlackBuild | 108 | ||||
-rw-r--r-- | network/smb4k/smb4k.info | 10 |
6 files changed, 0 insertions, 536 deletions
diff --git a/network/smb4k/README b/network/smb4k/README deleted file mode 100644 index a47fd61932b9..000000000000 --- a/network/smb4k/README +++ /dev/null @@ -1,3 +0,0 @@ -Smb4K is an advanced network neighborhood browser for KDE and a frontend -to the programs of the Samba software suite. Its purpose is to provide -a program that's easy to use and has as many features as possible. diff --git a/network/smb4k/doinst.sh b/network/smb4k/doinst.sh deleted file mode 100644 index a48fbcfa988f..000000000000 --- a/network/smb4k/doinst.sh +++ /dev/null @@ -1,30 +0,0 @@ -config() { - NEW="$1" - OLD="$(dirname $NEW)/$(basename $NEW .new)" - # If there's no config file by that name, mv it over: - if [ ! -r $OLD ]; then - mv $NEW $OLD - elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then - # toss the redundant copy - rm $NEW - fi - # Otherwise, we leave the .new copy for the admin to consider... -} - -config etc/dbus-1/system.d/net.sourceforge.smb4k.mounthelper.conf.new - -if [ -x /usr/bin/update-desktop-database ]; then - /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 -fi - -if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then - if [ -x /usr/bin/gtk-update-icon-cache ]; then - /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1 - fi -fi - -# Reload messagebus service -if [ -x etc/rc.d/rc.messagebus ]; then - chroot . /etc/rc.d/rc.messagebus reload -fi - diff --git a/network/smb4k/find_mount_umount.patch b/network/smb4k/find_mount_umount.patch deleted file mode 100644 index 35151180d751..000000000000 --- a/network/smb4k/find_mount_umount.patch +++ /dev/null @@ -1,366 +0,0 @@ -From 71554140bdaede27b95dbe4c9b5a028a83c83cce Mon Sep 17 00:00:00 2001 -From: Alexander Reinholdt <alexander.reinholdt@kdemail.net> -Date: Wed, 10 May 2017 10:23:34 +0200 -Subject: Find the mount/umount commands in the helper - -Instead of trusting what we get passed in -CVE-2017-8849 ---- - core/smb4kglobal.cpp | 65 +++++++++++++++++++++++++++++++++++- - core/smb4kglobal.h | 16 ++++++++- - core/smb4kmounter_p.cpp | 78 ++++---------------------------------------- - helpers/CMakeLists.txt | 6 +++- - helpers/smb4kmounthelper.cpp | 51 +++++++++++++++++++++++++++-- - 5 files changed, 139 insertions(+), 77 deletions(-) - -diff --git a/core/smb4kglobal.cpp b/core/smb4kglobal.cpp -index 172016f..818a78a 100644 ---- a/core/smb4kglobal.cpp -+++ b/core/smb4kglobal.cpp -@@ -2,7 +2,7 @@ - smb4kglobal - This is the global namespace for Smb4K. - ------------------- - begin : Sa Apr 2 2005 -- copyright : (C) 2005-2014 by Alexander Reinholdt -+ copyright : (C) 2005-2017 by Alexander Reinholdt - email : alexander.reinholdt@kdemail.net - ***************************************************************************/ - -@@ -851,3 +851,66 @@ QStringList Smb4KGlobal::whitelistedMountArguments() - #endif - - -+const QString Smb4KGlobal::findMountExecutable() -+{ -+ QString mount; -+ QStringList paths; -+ paths << "/bin"; -+ paths << "/sbin"; -+ paths << "/usr/bin"; -+ paths << "/usr/sbin"; -+ paths << "/usr/local/bin"; -+ paths << "/usr/local/sbin"; -+ -+ for (int i = 0; i < paths.size(); ++i) -+ { -+#if defined(Q_OS_LINUX) -+ mount = KGlobal::dirs()->findExe("mount.cifs", paths.at(i)); -+#elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) -+ mount = KGlobal::dirs()->findExe("mount_smbfs", paths.at(i)); -+#endif -+ -+ if (!mount.isEmpty()) -+ { -+ break; -+ } -+ else -+ { -+ continue; -+ } -+ } -+ -+ return mount; -+} -+ -+ -+const QString Smb4KGlobal::findUmountExecutable() -+{ -+ // Find the umount program. -+ QString umount; -+ QStringList paths; -+ paths << "/bin"; -+ paths << "/sbin"; -+ paths << "/usr/bin"; -+ paths << "/usr/sbin"; -+ paths << "/usr/local/bin"; -+ paths << "/usr/local/sbin"; -+ -+ for ( int i = 0; i < paths.size(); ++i ) -+ { -+ umount = KGlobal::dirs()->findExe("umount", paths.at(i)); -+ -+ if (!umount.isEmpty()) -+ { -+ break; -+ } -+ else -+ { -+ continue; -+ } -+ } -+ -+ return umount; -+} -+ -+ -diff --git a/core/smb4kglobal.h b/core/smb4kglobal.h -index db1805b..0ef377d 100644 ---- a/core/smb4kglobal.h -+++ b/core/smb4kglobal.h -@@ -2,7 +2,7 @@ - smb4kglobal - This is the global namespace for Smb4K. - ------------------- - begin : Sa Apr 2 2005 -- copyright : (C) 2005-2014 by Alexander Reinholdt -+ copyright : (C) 2005-2017 by Alexander Reinholdt - email : alexander.reinholdt@kdemail.net - ***************************************************************************/ - -@@ -455,6 +455,20 @@ namespace Smb4KGlobal - */ - KDE_EXPORT QStringList whitelistedMountArguments(); - #endif -+ -+ /** -+ * Find the mount executable on the system. -+ * -+ * @returns the path of the mount executable. -+ */ -+ KDE_EXPORT const QString findMountExecutable(); -+ -+ /** -+ * Find the umount executable on the system. -+ * -+ * @returns the path of the umount executable. -+ */ -+ KDE_EXPORT const QString findUmountExecutable(); - }; - - #endif -diff --git a/core/smb4kmounter_p.cpp b/core/smb4kmounter_p.cpp -index 63a87ed..342052a 100644 ---- a/core/smb4kmounter_p.cpp -+++ b/core/smb4kmounter_p.cpp -@@ -207,30 +207,7 @@ bool Smb4KMountJob::createMountAction(Smb4KShare *share, Action *action) - // - bool Smb4KMountJob::fillArgs(Smb4KShare *share, QMap<QString, QVariant>& map) - { -- // Find the mount program. -- QString mount; -- QStringList paths; -- paths << "/bin"; -- paths << "/sbin"; -- paths << "/usr/bin"; -- paths << "/usr/sbin"; -- paths << "/usr/local/bin"; -- paths << "/usr/local/sbin"; -- -- for (int i = 0; i < paths.size(); ++i) -- { -- mount = KGlobal::dirs()->findExe("mount.cifs", paths.at(i)); -- -- if (!mount.isEmpty()) -- { -- map.insert("mh_command", mount); -- break; -- } -- else -- { -- continue; -- } -- } -+ const QString mount = findMountExecutable(); - - if (mount.isEmpty()) - { -@@ -242,6 +219,8 @@ bool Smb4KMountJob::fillArgs(Smb4KShare *share, QMap<QString, QVariant>& map) - // Do nothing - } - -+ map.insert("mh_command", mount); -+ - // Mount arguments. - QMap<QString, QString> global_options = globalSambaOptions(); - Smb4KCustomOptions *options = Smb4KCustomOptionsManager::self()->findOptions(share); -@@ -729,30 +708,7 @@ bool Smb4KMountJob::fillArgs(Smb4KShare *share, QMap<QString, QVariant>& map) - // - bool Smb4KMountJob::fillArgs(Smb4KShare *share, QMap<QString, QVariant>& map) - { -- // Find the mount program. -- QString mount; -- QStringList paths; -- paths << "/bin"; -- paths << "/sbin"; -- paths << "/usr/bin"; -- paths << "/usr/sbin"; -- paths << "/usr/local/bin"; -- paths << "/usr/local/sbin"; -- -- for (int i = 0; i < paths.size(); ++i) -- { -- mount = KGlobal::dirs()->findExe("mount_smbfs", paths.at(i)); -- -- if (!mount.isEmpty()) -- { -- map.insert("mh_command", mount); -- break; -- } -- else -- { -- continue; -- } -- } -+ const QString mount = findMountExecutable(); - - if (mount.isEmpty()) - { -@@ -764,6 +720,8 @@ bool Smb4KMountJob::fillArgs(Smb4KShare *share, QMap<QString, QVariant>& map) - // Do nothing - } - -+ map.insert("mh_command", mount); -+ - // Mount arguments. - QMap<QString, QString> global_options = globalSambaOptions(); - Smb4KCustomOptions *options = Smb4KCustomOptionsManager::self()->findOptions(share); -@@ -1253,29 +1211,7 @@ bool Smb4KUnmountJob::createUnmountAction(Smb4KShare *share, Action *action) - // Do nothing - } - -- // Find the umount program. -- QString umount; -- QStringList paths; -- paths << "/bin"; -- paths << "/sbin"; -- paths << "/usr/bin"; -- paths << "/usr/sbin"; -- paths << "/usr/local/bin"; -- paths << "/usr/local/sbin"; -- -- for ( int i = 0; i < paths.size(); ++i ) -- { -- umount = KGlobal::dirs()->findExe("umount", paths.at(i)); -- -- if (!umount.isEmpty()) -- { -- break; -- } -- else -- { -- continue; -- } -- } -+ const QString umount = findUmountExecutable(); - - if (umount.isEmpty() && !m_silent) - { -diff --git a/helpers/CMakeLists.txt b/helpers/CMakeLists.txt -index e9e670b..cd4228d 100644 ---- a/helpers/CMakeLists.txt -+++ b/helpers/CMakeLists.txt -@@ -1,7 +1,11 @@ -+include_directories( -+ ${CMAKE_SOURCE_DIR}/core -+ ${CMAKE_BINARY_DIR}/core ) -+ - set( smb4kmounthelper_SRCS smb4kmounthelper.cpp ) - - kde4_add_executable( mounthelper ${smb4kmounthelper_SRCS} ) --target_link_libraries( mounthelper ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ) -+target_link_libraries( mounthelper smb4kcore ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ) - install( TARGETS mounthelper DESTINATION ${LIBEXEC_INSTALL_DIR} ) - - kde4_install_auth_helper_files( mounthelper net.sourceforge.smb4k.mounthelper root ) -diff --git a/helpers/smb4kmounthelper.cpp b/helpers/smb4kmounthelper.cpp -index a2f2fed..7959020 100644 ---- a/helpers/smb4kmounthelper.cpp -+++ b/helpers/smb4kmounthelper.cpp -@@ -29,6 +29,7 @@ - - // application specific includes - #include "smb4kmounthelper.h" -+#include "core/smb4kglobal.h" - - // Qt includes - #include <QProcessEnvironment> -@@ -43,12 +44,35 @@ - #include <kmountpoint.h> - #include <kurl.h> - -+using namespace Smb4KGlobal; -+ - KDE4_AUTH_HELPER_MAIN( "net.sourceforge.smb4k.mounthelper", Smb4KMountHelper ) - - - ActionReply Smb4KMountHelper::mount(const QVariantMap &args) - { - ActionReply reply; -+ -+ // -+ // Get the mount executable -+ // -+ const QString mount = findMountExecutable(); -+ -+ // -+ // Check the executable -+ // -+ if (mount != args["mh_command"].toString()) -+ { -+ // Something weird is going on, bail out. -+ reply.setErrorCode(ActionReply::HelperError); -+ reply.setErrorDescription(i18n("Wrong executable passed. Bailing out.")); -+ return reply; -+ } -+ else -+ { -+ // Do nothing -+ } -+ - // The mountpoint is a unique and can be used to - // find the share. - reply.addData("mh_mountpoint", args["mh_mountpoint"]); -@@ -75,12 +99,12 @@ ActionReply Smb4KMountHelper::mount(const QVariantMap &args) - // Set the mount command here. - QStringList command; - #if defined(Q_OS_LINUX) -- command << args["mh_command"].toString(); -+ command << mount; - command << args["mh_unc"].toString(); - command << args["mh_mountpoint"].toString(); - command << args["mh_options"].toStringList(); - #elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) -- command << args["mh_command"].toString(); -+ command << mount; - command << args["mh_options"].toStringList(); - command << args["mh_unc"].toString(); - command << args["mh_mountpoint"].toString(); -@@ -161,6 +185,27 @@ ActionReply Smb4KMountHelper::mount(const QVariantMap &args) - ActionReply Smb4KMountHelper::unmount(const QVariantMap &args) - { - ActionReply reply; -+ -+ // -+ // Get the umount executable -+ // -+ const QString umount = findUmountExecutable(); -+ -+ // -+ // Check the executable -+ // -+ if (umount != args["mh_command"].toString()) -+ { -+ // Something weird is going on, bail out. -+ reply.setErrorCode(ActionReply::HelperError); -+ reply.setErrorDescription(i18n("Wrong executable passed. Bailing out.")); -+ return reply; -+ } -+ else -+ { -+ // Do nothing -+ } -+ - // The mountpoint is a unique and can be used to - // find the share. - reply.addData("mh_mountpoint", args["mh_mountpoint"]); -@@ -208,7 +253,7 @@ ActionReply Smb4KMountHelper::unmount(const QVariantMap &args) - - // Set the umount command here. - QStringList command; -- command << args["mh_command"].toString(); -+ command << umount; - command << args["mh_options"].toStringList(); - command << args["mh_mountpoint"].toString(); - --- -cgit v0.11.2 - diff --git a/network/smb4k/slack-desc b/network/smb4k/slack-desc deleted file mode 100644 index 392f44fb1dd2..000000000000 --- a/network/smb4k/slack-desc +++ /dev/null @@ -1,19 +0,0 @@ -# HOW TO EDIT THIS FILE: -# The "handy ruler" below makes it easier to edit a package description. -# Line up the first '|' above the ':' following the base package name, and -# the '|' on the right side marks the last column you can put a character in. -# You must make exactly 11 lines for the formatting to be correct. It's also -# customary to leave one space after the ':' except on otherwise blank lines. - - |-----handy-ruler------------------------------------------------------| -smb4k: smb4k (A SMB Share Browser) -smb4k: -smb4k: Smb4K is an advanced network neighborhood browser for KDE and a -smb4k: frontend to the programs of the Samba software suite. Its purpose is -smb4k: to provide a program that's easy to use and has as many features as -smb4k: possible. -smb4k: -smb4k: Homepage: http://smb4k.sourceforge.net/ -smb4k: -smb4k: -smb4k: diff --git a/network/smb4k/smb4k.SlackBuild b/network/smb4k/smb4k.SlackBuild deleted file mode 100644 index 03be76ba73d1..000000000000 --- a/network/smb4k/smb4k.SlackBuild +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh - -# Slackware build script for smb4k - -# Copyright 2008-2013 Roberto Neri, Palermo, Italy -# -# All rights reserved. -# -# Redistribution and use of this script, with or without modification, is -# permitted provided that the following conditions are met: -# -# 1. Redistributions of this script must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -PRGNAM=smb4k -VERSION=${VERSION:-1.2.3} -BUILD=${BUILD:-1} -TAG=${TAG:-_SBo} - -if [ -z "$ARCH" ]; then - case "$( uname -m )" in - i?86) ARCH=i486 ;; - arm*) ARCH=arm ;; - *) ARCH=$( uname -m ) ;; - esac -fi - -CWD=$(pwd) -TMP=${TMP:-/tmp/SBo} -PKG=$TMP/package-$PRGNAM -OUTPUT=${OUTPUT:-/tmp} - -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" - LIBDIRSUFFIX="64" -else - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" -fi - -set -e - -rm -rf $PKG -mkdir -p $TMP $PKG $OUTPUT -cd $TMP -rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* -cd $PRGNAM-$VERSION -chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \ - -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; - -# Fix for CVE-2017-8849 -patch -p1 < $CWD/find_mount_umount.patch - -mkdir build -cd build - cmake \ - -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ - -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DMAN_INSTALL_DIR=/usr/man \ - -DSYSCONF_INSTALL_DIR=/etc \ - -DLIB_SUFFIX=${LIBDIRSUFFIX} \ - .. - make - make install DESTDIR=$PKG -cd .. - -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 - -mv $PKG/etc/dbus-1/system.d/net.sourceforge.smb4k.mounthelper.conf \ - $PKG/etc/dbus-1/system.d/net.sourceforge.smb4k.mounthelper.conf.new - -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a \ - AUTHORS BUGS ChangeLog COPYING README \ - $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild - -mkdir -p $PKG/install -cat $CWD/doinst.sh > $PKG/install/doinst.sh -cat $CWD/slack-desc > $PKG/install/slack-desc - -cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/smb4k/smb4k.info b/network/smb4k/smb4k.info deleted file mode 100644 index 4b77a2b7e8a7..000000000000 --- a/network/smb4k/smb4k.info +++ /dev/null @@ -1,10 +0,0 @@ -PRGNAM="smb4k" -VERSION="1.2.3" -HOMEPAGE="http://smb4k.sourceforge.net/" -DOWNLOAD="http://downloads.sourceforge.net/smb4k/smb4k-1.2.3.tar.xz" -MD5SUM="1f4723a7891e41a5d86397765c6863d4" -DOWNLOAD_x86_64="" -MD5SUM_x86_64="" -REQUIRES="" -MAINTAINER="nobody" -EMAIL="nobody@nowhere" |