diff options
author | Gleb Popov <arrowd@FreeBSD.org> | 2020-03-05 13:38:00 +0000 |
---|---|---|
committer | Gleb Popov <arrowd@FreeBSD.org> | 2020-03-05 13:38:00 +0000 |
commit | a1a5ae3a7e79c3c7ad4ce5e88fef409227a0d84a (patch) | |
tree | 10560216749692bc1e6a90b24159ad5889136bbd /x11/sddm | |
parent | 0058f938deaca2f7f6d2143a32ee25377af851fd (diff) | |
download | ports-a1a5ae3a7e79c3c7ad4ce5e88fef409227a0d84a.tar.gz ports-a1a5ae3a7e79c3c7ad4ce5e88fef409227a0d84a.zip |
Notes
Diffstat (limited to 'x11/sddm')
-rw-r--r-- | x11/sddm/Makefile | 2 | ||||
-rw-r--r-- | x11/sddm/files/patch-src_helper_Backend.cpp | 32 |
2 files changed, 21 insertions, 13 deletions
diff --git a/x11/sddm/Makefile b/x11/sddm/Makefile index 1d84444853d9..c0115563223d 100644 --- a/x11/sddm/Makefile +++ b/x11/sddm/Makefile @@ -3,7 +3,7 @@ PORTNAME= sddm PORTVERSION= 0.18.1 DISTVERSIONPREFIX= v -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11 MAINTAINER= kde@FreeBSD.org diff --git a/x11/sddm/files/patch-src_helper_Backend.cpp b/x11/sddm/files/patch-src_helper_Backend.cpp index a94ab6a52146..62a2f1cde51b 100644 --- a/x11/sddm/files/patch-src_helper_Backend.cpp +++ b/x11/sddm/files/patch-src_helper_Backend.cpp @@ -1,5 +1,5 @@ ---- src/helper/Backend.cpp.orig 2019-03-13 10:22:35.000000000 +0100 -+++ src/helper/Backend.cpp 2020-02-16 16:39:53.134892000 +0100 +--- src/helper/Backend.cpp.orig 2019-03-13 09:22:35 UTC ++++ src/helper/Backend.cpp @@ -29,6 +29,10 @@ #include <QtCore/QProcessEnvironment> @@ -11,29 +11,37 @@ namespace SDDM { Backend::Backend(HelperApp* parent) -@@ -70,6 +74,26 @@ +@@ -70,6 +74,34 @@ namespace SDDM { .arg(mainConfig.X11.UserAuthFile.get()); env.insert(QStringLiteral("XAUTHORITY"), value); } +#if defined(Q_OS_FREEBSD) + /* get additional environment variables via setclassenvironment(); + this needs to be done here instead of in UserSession::setupChildProcess -+ as the environment for execve() is prepared here */ ++ as the environment for execve() is prepared here; ++ save and restore SDDM's environment because setclassenvironment() mangles it */ + login_cap_t *lc; + -+ if ((lc = login_getpwclass(pw)) != 0) { ++ auto savedEnv = QProcessEnvironment::systemEnvironment(); ++ ++ if ((lc = login_getpwclass(pw)) != NULL) { + setclassenvironment(lc, pw, 1); /* path variables */ + setclassenvironment(lc, pw, 0); /* non-path variables */ + login_close(lc); -+ if ((lc = login_getuserclass(pw)) != NULL) { -+ setclassenvironment(lc, pw, 1); -+ setclassenvironment(lc, pw, 0); -+ } -+ if (lc != NULL) -+ login_close(lc); ++ } ++ if ((lc = login_getuserclass(pw)) != NULL) { ++ setclassenvironment(lc, pw, 1); /* path variables */ ++ setclassenvironment(lc, pw, 0); /* non-path variables */ ++ login_close(lc); ++ } + /* copy all environment variables that are now set */ ++ QString savedLang = env.value(QStringLiteral("LANG")); + env.insert(QProcessEnvironment::systemEnvironment()); -+ } ++ if (qobject_cast<HelperApp*>(parent())->user() == QStringLiteral("sddm")) ++ env.insert(QStringLiteral("LANG"), savedLang); ++ /* restore original environment */ ++ QProcessEnvironment::systemEnvironment().clear(); ++ QProcessEnvironment::systemEnvironment().insert(savedEnv); +#endif /* defined(Q_OS_FREEBSD) */ // TODO: I'm fairly sure this shouldn't be done for PAM sessions, investigate! m_app->session()->setProcessEnvironment(env); |