$OpenBSD: patch-autotests_kconfigtest_cpp,v 1.1 2019/08/21 06:18:57 rsadowski Exp $

CVE-2019-14744
Security: remove support for $(...) in config keys with [$e] marker.

https://kde.org/info/security/advisory-20190807-1.txt

Index: autotests/kconfigtest.cpp
--- autotests/kconfigtest.cpp.orig
+++ autotests/kconfigtest.cpp
@@ -38,7 +38,7 @@
 #include <utime.h>
 #endif
 #ifndef Q_OS_WIN
-#include <unistd.h> // gethostname
+#include <unistd.h> // getuid
 #endif
 
 KCONFIGGROUP_DECLARE_ENUM_QOBJECT(KConfigTest, Testing)
@@ -545,14 +545,8 @@ void KConfigTest::testPath()
     QCOMPARE(group.readPathEntry("withBraces", QString()), QString("file://" + HOMEPATH));
     QVERIFY(group.hasKey("URL"));
     QCOMPARE(group.readEntry("URL", QString()), QString("file://" + HOMEPATH));
-#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
-    // I don't know if this will work on windows
-    // This test hangs on OS X
     QVERIFY(group.hasKey("hostname"));
-    char hostname[256];
-    QVERIFY(::gethostname(hostname, sizeof(hostname)) == 0);
-    QCOMPARE(group.readEntry("hostname", QString()), QString::fromLatin1(hostname));
-#endif
+    QCOMPARE(group.readEntry("hostname", QString()), QStringLiteral("(hostname)")); // the $ got removed because empty var name
     QVERIFY(group.hasKey("noeol"));
     QCOMPARE(group.readEntry("noeol", QString()), QString("foo"));
 
