diff --git a/0001-Fix-reading-environment-variables-with-newline.patch b/0001-Fix-reading-environment-variables-with-newline.patch new file mode 100644 index 0000000..3de9af5 --- /dev/null +++ b/0001-Fix-reading-environment-variables-with-newline.patch @@ -0,0 +1,53 @@ +From 3f7e44cade8aae45396f6bbdd22c60ce4cd508d2 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Fri, 18 Oct 2019 09:36:27 +0200 +Subject: [PATCH] Fix reading environment variables with newline + +Summary: +Use '\0' as separator as '\n' is likely to appear in values. + +BUG: 413130 + +Test Plan: +/etc/profile.d/mc.sh exported an mc() function, +which resulted in "syntax error: unexpected end of file" in the Plasma session. +Now the mc function is correctly set in the environment. + +Reviewers: #plasma, apol + +Subscribers: plasma-devel + +Tags: #plasma + +Differential Revision: https://phabricator.kde.org/D24750 +--- + startkde/plasma-sourceenv.sh | 2 +- + startkde/startplasma.cpp | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/startkde/plasma-sourceenv.sh b/startkde/plasma-sourceenv.sh +index 70c3b6487..b8a50aa0d 100644 +--- a/startkde/plasma-sourceenv.sh ++++ b/startkde/plasma-sourceenv.sh +@@ -3,4 +3,4 @@ do + . $i >/dev/null + done + +-env ++env -0 +diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp +index e0f7004b4..cb4eda2b8 100644 +--- a/startkde/startplasma.cpp ++++ b/startkde/startplasma.cpp +@@ -91,7 +91,7 @@ void sourceFiles(const QStringList &files) + p.waitForFinished(-1); + + const auto fullEnv = p.readAllStandardOutput(); +- auto envs = fullEnv.split('\n'); ++ auto envs = fullEnv.split('\0'); + + for (auto &env: envs) { + if (env.startsWith("_=") || env.startsWith("SHLVL")) +-- +2.22.0 + diff --git a/plasma5-workspace.changes b/plasma5-workspace.changes index 19afa3b..efe913f 100644 --- a/plasma5-workspace.changes +++ b/plasma5-workspace.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Oct 18 07:48:42 UTC 2019 - Fabian Vogt + +- Add patch to fix reading environment variables with newline + (boo#1154345, kde#413130): + * 0001-Fix-reading-environment-variables-with-newline.patch + ------------------------------------------------------------------- Tue Oct 15 13:44:23 UTC 2019 - Fabian Vogt diff --git a/plasma5-workspace.spec b/plasma5-workspace.spec index 21fc8db..6b0b898 100644 --- a/plasma5-workspace.spec +++ b/plasma5-workspace.spec @@ -42,6 +42,7 @@ Source3: baselibs.conf Source4: plasmafullwayland.desktop # PATCH-FIX-UPSTREAM Patch1: 0001-gmenu-dbusmenu-proxy-Don-t-create-.gtkrc-2.0.patch +Patch2: 0001-Fix-reading-environment-variables-with-newline.patch # PATCHES 501-??? are PATCH-FIX-OPENSUSE Patch501: 0001-Use-qdbus-qt5.patch Patch502: 0001-Ignore-default-sddm-face-icons.patch