kdePackages.plasma-vault: hardcode more paths, fix existing hardcoded path (#470405)
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
From fef6bfe87db4411e3dda2f96741cd8204fe41d85 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Tuegel <ttuegel@mailbox.org>
|
||||
Date: Tue, 2 Nov 2021 05:57:50 -0500
|
||||
Subject: [PATCH 1/3] encfs path
|
||||
|
||||
---
|
||||
kded/engine/backends/encfs/encfsbackend.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/kded/engine/backends/encfs/encfsbackend.cpp b/kded/engine/backends/encfs/encfsbackend.cpp
|
||||
index 2d15fa2..3f49867 100644
|
||||
--- a/kded/engine/backends/encfs/encfsbackend.cpp
|
||||
+++ b/kded/engine/backends/encfs/encfsbackend.cpp
|
||||
@@ -101,12 +101,12 @@ QProcess *EncFsBackend::encfs(const QStringList &arguments) const
|
||||
auto config = KSharedConfig::openConfig(PLASMAVAULT_CONFIG_FILE);
|
||||
KConfigGroup backendConfig(config, "EncfsBackend");
|
||||
|
||||
- return process("encfs", arguments + backendConfig.readEntry("extraMountOptions", QStringList{}), {});
|
||||
+ return process(NIXPKGS_ENCFS, arguments + backendConfig.readEntry("extraMountOptions", QStringList{}), {});
|
||||
}
|
||||
|
||||
QProcess *EncFsBackend::encfsctl(const QStringList &arguments) const
|
||||
{
|
||||
- return process("encfsctl", arguments, {});
|
||||
+ return process(NIXPKGS_ENCFSCTL, arguments, {});
|
||||
}
|
||||
|
||||
} // namespace PlasmaVault
|
||||
--
|
||||
2.33.1
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
From a89a0d3f9088d272c01ccb9b730d1dbb500f9cb8 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Tuegel <ttuegel@mailbox.org>
|
||||
Date: Tue, 2 Nov 2021 05:59:34 -0500
|
||||
Subject: [PATCH 2/3] cryfs path
|
||||
|
||||
---
|
||||
kded/engine/backends/cryfs/cryfsbackend.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/kded/engine/backends/cryfs/cryfsbackend.cpp b/kded/engine/backends/cryfs/cryfsbackend.cpp
|
||||
index 64138b6..1a9fde2 100644
|
||||
--- a/kded/engine/backends/cryfs/cryfsbackend.cpp
|
||||
+++ b/kded/engine/backends/cryfs/cryfsbackend.cpp
|
||||
@@ -207,7 +207,7 @@ QProcess *CryFsBackend::cryfs(const QStringList &arguments) const
|
||||
auto config = KSharedConfig::openConfig(PLASMAVAULT_CONFIG_FILE);
|
||||
KConfigGroup backendConfig(config, "CryfsBackend");
|
||||
|
||||
- return process("cryfs", arguments + backendConfig.readEntry("extraMountOptions", QStringList{}), {{"CRYFS_FRONTEND", "noninteractive"}});
|
||||
+ return process(NIXPKGS_CRYFS, arguments + backendConfig.readEntry("extraMountOptions", QStringList{}), {{"CRYFS_FRONTEND", "noninteractive"}});
|
||||
}
|
||||
|
||||
} // namespace PlasmaVault
|
||||
--
|
||||
2.33.1
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
diff --git a/kded/engine/fusebackend_p.cpp b/kded/engine/fusebackend_p.cpp
|
||||
index 714b660..cb384fc 100644
|
||||
--- a/kded/engine/fusebackend_p.cpp
|
||||
+++ b/kded/engine/fusebackend_p.cpp
|
||||
@@ -90,7 +90,7 @@ QProcess *FuseBackend::process(const QString &executable, const QStringList &arg
|
||||
|
||||
QProcess *FuseBackend::fusermount(const QStringList &arguments) const
|
||||
{
|
||||
- return process(fusermountExecutable, arguments, {});
|
||||
+ return process(NIXPKGS_FUSERMOUNT, arguments, {});
|
||||
}
|
||||
|
||||
FutureResult<> FuseBackend::initialize(const QString &name, const Device &device, const MountPoint &mountPoint, const Vault::Payload &payload)
|
||||
@@ -1,13 +0,0 @@
|
||||
diff --git a/kded/engine/backends/gocryptfs/gocryptfsbackend.cpp b/kded/engine/backends/gocryptfs/gocryptfsbackend.cpp
|
||||
index 2d6df94..3e8ec9a 100644
|
||||
--- a/kded/engine/backends/gocryptfs/gocryptfsbackend.cpp
|
||||
+++ b/kded/engine/backends/gocryptfs/gocryptfsbackend.cpp
|
||||
@@ -202,7 +202,7 @@ QProcess *GocryptfsBackend::gocryptfs(const QStringList &arguments) const
|
||||
auto config = KSharedConfig::openConfig(PLASMAVAULT_CONFIG_FILE);
|
||||
KConfigGroup backendConfig(config, "GocryptfsBackend");
|
||||
|
||||
- return process("gocryptfs", arguments + backendConfig.readEntry("extraMountOptions", QStringList{}), {});
|
||||
+ return process(NIXPKGS_GOCRYPTFS, arguments + backendConfig.readEntry("extraMountOptions", QStringList{}), {});
|
||||
}
|
||||
|
||||
QString GocryptfsBackend::getConfigFilePath(const Device &device) const
|
||||
@@ -1,28 +1,26 @@
|
||||
{
|
||||
lib,
|
||||
mkKdeDerivation,
|
||||
replaceVars,
|
||||
pkg-config,
|
||||
gocryptfs,
|
||||
fuse,
|
||||
cryfs,
|
||||
encfs,
|
||||
fuse,
|
||||
gocryptfs,
|
||||
lsof,
|
||||
}:
|
||||
mkKdeDerivation {
|
||||
pname = "plasma-vault";
|
||||
|
||||
patches = [
|
||||
./0001-encfs-path.patch
|
||||
./0002-cryfs-path.patch
|
||||
./0003-fusermount-path.patch
|
||||
./0004-gocryptfs-path.patch
|
||||
];
|
||||
|
||||
CXXFLAGS = [
|
||||
''-DNIXPKGS_ENCFS=\"${lib.getBin encfs}/bin/encfs\"''
|
||||
''-DNIXPKGS_ENCFSCTL=\"${lib.getBin encfs}/bin/encfsctl\"''
|
||||
''-DNIXPKGS_CRYFS=\"${lib.getBin cryfs}/bin/cryfs\"''
|
||||
''-DNIXPKGS_FUSERMOUNT=\"${lib.getBin fuse}/bin/fusermount3\"''
|
||||
''-DNIXPKGS_GOCRYPTFS=\"${lib.getBin gocryptfs}/bin/gocryptfs\"''
|
||||
(replaceVars ./hardcode-paths.patch {
|
||||
cryfs = lib.getExe' cryfs "cryfs";
|
||||
encfs = lib.getExe' encfs "encfs";
|
||||
encfsctl = lib.getExe' encfs "encfsctl";
|
||||
fusermount = lib.getExe' fuse "fusermount";
|
||||
gocryptfs = lib.getExe' gocryptfs "gocryptfs";
|
||||
lsof = lib.getExe lsof;
|
||||
})
|
||||
];
|
||||
|
||||
extraNativeBuildInputs = [ pkg-config ];
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
diff --git a/kded/engine/backends/cryfs/cryfsbackend.cpp b/kded/engine/backends/cryfs/cryfsbackend.cpp
|
||||
index f425eb3..5b8cd43 100644
|
||||
--- a/kded/engine/backends/cryfs/cryfsbackend.cpp
|
||||
+++ b/kded/engine/backends/cryfs/cryfsbackend.cpp
|
||||
@@ -207,7 +207,7 @@ QProcess *CryFsBackend::cryfs(const QStringList &arguments) const
|
||||
auto config = KSharedConfig::openConfig(PLASMAVAULT_CONFIG_FILE);
|
||||
KConfigGroup backendConfig(config, "CryfsBackend");
|
||||
|
||||
- return process("cryfs", arguments + backendConfig.readEntry("extraMountOptions", QStringList{}), {{"CRYFS_FRONTEND", "noninteractive"}});
|
||||
+ return process("@cryfs@", arguments + backendConfig.readEntry("extraMountOptions", QStringList{}), {{"CRYFS_FRONTEND", "noninteractive"}});
|
||||
}
|
||||
|
||||
} // namespace PlasmaVault
|
||||
diff --git a/kded/engine/backends/encfs/encfsbackend.cpp b/kded/engine/backends/encfs/encfsbackend.cpp
|
||||
index 2d15fa2..870b711 100644
|
||||
--- a/kded/engine/backends/encfs/encfsbackend.cpp
|
||||
+++ b/kded/engine/backends/encfs/encfsbackend.cpp
|
||||
@@ -101,12 +101,12 @@ QProcess *EncFsBackend::encfs(const QStringList &arguments) const
|
||||
auto config = KSharedConfig::openConfig(PLASMAVAULT_CONFIG_FILE);
|
||||
KConfigGroup backendConfig(config, "EncfsBackend");
|
||||
|
||||
- return process("encfs", arguments + backendConfig.readEntry("extraMountOptions", QStringList{}), {});
|
||||
+ return process("@encfs@", arguments + backendConfig.readEntry("extraMountOptions", QStringList{}), {});
|
||||
}
|
||||
|
||||
QProcess *EncFsBackend::encfsctl(const QStringList &arguments) const
|
||||
{
|
||||
- return process("encfsctl", arguments, {});
|
||||
+ return process("@encfsctl@", arguments, {});
|
||||
}
|
||||
|
||||
} // namespace PlasmaVault
|
||||
diff --git a/kded/engine/backends/gocryptfs/gocryptfsbackend.cpp b/kded/engine/backends/gocryptfs/gocryptfsbackend.cpp
|
||||
index b992f6f..eb828dd 100644
|
||||
--- a/kded/engine/backends/gocryptfs/gocryptfsbackend.cpp
|
||||
+++ b/kded/engine/backends/gocryptfs/gocryptfsbackend.cpp
|
||||
@@ -202,7 +202,7 @@ QProcess *GocryptfsBackend::gocryptfs(const QStringList &arguments) const
|
||||
auto config = KSharedConfig::openConfig(PLASMAVAULT_CONFIG_FILE);
|
||||
KConfigGroup backendConfig(config, "GocryptfsBackend");
|
||||
|
||||
- return process("gocryptfs", arguments + backendConfig.readEntry("extraMountOptions", QStringList{}), {});
|
||||
+ return process("@gocryptfs@", arguments + backendConfig.readEntry("extraMountOptions", QStringList{}), {});
|
||||
}
|
||||
|
||||
QString GocryptfsBackend::getConfigFilePath(const Device &device) const
|
||||
diff --git a/kded/engine/fusebackend_p.cpp b/kded/engine/fusebackend_p.cpp
|
||||
index 8763304..e6860d2 100644
|
||||
--- a/kded/engine/fusebackend_p.cpp
|
||||
+++ b/kded/engine/fusebackend_p.cpp
|
||||
@@ -90,7 +90,7 @@ QProcess *FuseBackend::process(const QString &executable, const QStringList &arg
|
||||
|
||||
QProcess *FuseBackend::fusermount(const QStringList &arguments) const
|
||||
{
|
||||
- return process(fusermountExecutable, arguments, {});
|
||||
+ return process("@fusermount@", arguments, {});
|
||||
}
|
||||
|
||||
FutureResult<> FuseBackend::initialize(const QString &name, const Device &device, const MountPoint &mountPoint, const Vault::Payload &payload)
|
||||
diff --git a/kded/engine/vault.cpp b/kded/engine/vault.cpp
|
||||
index c101079..67c8a83 100644
|
||||
--- a/kded/engine/vault.cpp
|
||||
+++ b/kded/engine/vault.cpp
|
||||
@@ -485,7 +485,7 @@ FutureResult<> Vault::close()
|
||||
} else {
|
||||
// We want to check whether there is an application
|
||||
// that is accessing the vault
|
||||
- AsynQt::Process::getOutput(QStringLiteral("lsof"), {QStringLiteral("-t"), mountPoint().data()}) | cast<QString>() | onError([this] {
|
||||
+ AsynQt::Process::getOutput(QStringLiteral("@lsof@"), {QStringLiteral("-t"), mountPoint().data()}) | cast<QString>() | onError([this] {
|
||||
d->updateMessage(i18n("Unable to lock the vault because an application is using it"));
|
||||
}) | onSuccess([this](const QString &result) {
|
||||
// based on ksolidnotify.cpp
|
||||
@@ -538,7 +538,7 @@ FutureResult<> Vault::forceClose()
|
||||
using namespace AsynQt::operators;
|
||||
|
||||
AsynQt::await(
|
||||
- AsynQt::Process::getOutput(QStringLiteral("lsof"), { QStringLiteral("-t"), mountPoint().data() })
|
||||
+ AsynQt::Process::getOutput(QStringLiteral("@lsof@"), { QStringLiteral("-t"), mountPoint().data() })
|
||||
| cast<QString>()
|
||||
| onError([this] {
|
||||
d->updateMessage(i18n("Failed to fetch the list of applications using this vault"));
|
||||
diff --git a/kded/ui/cryfscypherchooserwidget.cpp b/kded/ui/cryfscypherchooserwidget.cpp
|
||||
index bbe76ef..dbd27ac 100644
|
||||
--- a/kded/ui/cryfscypherchooserwidget.cpp
|
||||
+++ b/kded/ui/cryfscypherchooserwidget.cpp
|
||||
@@ -39,7 +39,7 @@ void CryfsCypherChooserWidget::initializeCyphers()
|
||||
// TODO: This needs to be prettier -- for modules to be able
|
||||
// to reach their backends directly
|
||||
auto process = new QProcess();
|
||||
- process->setProgram("cryfs");
|
||||
+ process->setProgram("@cryfs@");
|
||||
process->setArguments({"--show-ciphers"});
|
||||
|
||||
auto env = process->processEnvironment();
|
||||
Reference in New Issue
Block a user