svn commit: r527832 - in head/x11/sddm: . files

Gleb Popov arrowd at FreeBSD.org
Thu Mar 5 13:38:04 UTC 2020


Author: arrowd
Date: Thu Mar  5 13:38:00 2020
New Revision: 527832
URL: https://svnweb.freebsd.org/changeset/ports/527832

Log:
  lang/sddm: Make SDDM honour sddm_lang rc variable again.
  
  PR:		244341
  Submitted by:	Martin Birgmeier <d8zNeCFG at aon.at> (initial patch)

Modified:
  head/x11/sddm/Makefile
  head/x11/sddm/files/patch-src_helper_Backend.cpp

Modified: head/x11/sddm/Makefile
==============================================================================
--- head/x11/sddm/Makefile	Thu Mar  5 13:33:35 2020	(r527831)
+++ head/x11/sddm/Makefile	Thu Mar  5 13:38:00 2020	(r527832)
@@ -3,7 +3,7 @@
 PORTNAME=	sddm
 PORTVERSION=	0.18.1
 DISTVERSIONPREFIX=	v
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	x11
 
 MAINTAINER=	kde at FreeBSD.org

Modified: head/x11/sddm/files/patch-src_helper_Backend.cpp
==============================================================================
--- head/x11/sddm/files/patch-src_helper_Backend.cpp	Thu Mar  5 13:33:35 2020	(r527831)
+++ head/x11/sddm/files/patch-src_helper_Backend.cpp	Thu Mar  5 13:38:00 2020	(r527832)
@@ -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);


More information about the svn-ports-all mailing list