diff options
Diffstat (limited to 'gnu/packages/patches/kio-search-smbd-on-PATH.patch')
-rw-r--r-- | gnu/packages/patches/kio-search-smbd-on-PATH.patch | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/gnu/packages/patches/kio-search-smbd-on-PATH.patch b/gnu/packages/patches/kio-search-smbd-on-PATH.patch index 55535ffa11..5118c9a361 100644 --- a/gnu/packages/patches/kio-search-smbd-on-PATH.patch +++ b/gnu/packages/patches/kio-search-smbd-on-PATH.patch @@ -1,30 +1,24 @@ -Adopted from NixOS -pkgs/development/libraries/kde-frameworks/kio/samba-search-path.patch +From af54a2a37655df26a33bc6783cb472c38f65322f Mon Sep 17 00:00:00 2001 +From: Thomas Tuegel <ttuegel@mailbox.org> +Date: Sun, 28 Mar 2021 10:31:12 -0500 +Subject: [PATCH 1/2] Remove impure smbd search path -=================================================================== ---- kio-5.17.0.orig/src/core/ksambashare.cpp -+++ kio-5.17.0/src/core/ksambashare.cpp -@@ -67,13 +67,18 @@ KSambaSharePrivate::~KSambaSharePrivate( - +--- + src/core/ksambashare.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/core/ksambashare.cpp b/src/core/ksambashare.cpp +index e810ce4..7cfb4e6 100644 +--- a/src/core/ksambashare.cpp ++++ b/src/core/ksambashare.cpp +@@ -61,7 +61,7 @@ KSambaSharePrivate::~KSambaSharePrivate() bool KSambaSharePrivate::isSambaInstalled() { -- if (QFile::exists(QStringLiteral("/usr/sbin/smbd")) -- || QFile::exists(QStringLiteral("/usr/local/sbin/smbd"))) { -- return true; -+ const QByteArray pathEnv = qgetenv("PATH"); -+ if (!pathEnv.isEmpty()) { -+ QLatin1Char pathSep(':'); -+ QStringList paths = QFile::decodeName(pathEnv).split(pathSep, QString::SkipEmptyParts); -+ for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) { -+ it->append(QStringLiteral("/smbd")); -+ if (QFile::exists(*it)) { -+ return true; -+ } -+ } + const bool daemonExists = +- !QStandardPaths::findExecutable(QStringLiteral("smbd"), {QStringLiteral("/usr/sbin/"), QStringLiteral("/usr/local/sbin/")}).isEmpty(); ++ !QStandardPaths::findExecutable(QStringLiteral("smbd")).isEmpty(); + if (!daemonExists) { + qCDebug(KIO_CORE_SAMBASHARE) << "KSambaShare: Could not find smbd"; } - -- //qDebug() << "Samba is not installed!"; -- - return false; - } - +-- +2.30.1 |