FreeBSD Bugzilla – Attachment 211999 Details for
Bug 244341
x11/sddm: sddm_lang variable in rc.d script does not affect anything
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to use setclassenvironment() without mangling SDDM's environment
patch-src_helper_Backend.cpp (text/plain), 1.73 KB, created by
Martin Birgmeier
on 2020-02-27 18:28:03 UTC
(
hide
)
Description:
patch to use setclassenvironment() without mangling SDDM's environment
Filename:
MIME Type:
Creator:
Martin Birgmeier
Created:
2020-02-27 18:28:03 UTC
Size:
1.73 KB
patch
obsolete
>--- src/helper/Backend.cpp.orig 2019-03-13 10:22:35.000000000 +0100 >+++ src/helper/Backend.cpp 2020-02-27 19:25:22.382464000 +0100 >@@ -29,6 +29,13 @@ > #include <QtCore/QProcessEnvironment> > > #include <pwd.h> >+#if defined(Q_OS_FREEBSD) >+#include <sys/types.h> >+#include <login_cap.h> >+extern "C" { >+ extern char **environ; >+} >+#endif /* defined(Q_OS_FREEBSD) */ > > namespace SDDM { > Backend::Backend(HelperApp* parent) >@@ -70,6 +77,31 @@ > .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; >+ save and restore SDDM's environment because setclassenvironment() mangles it */ >+ login_cap_t *lc; >+ char **environ_sddm = environ; >+ >+ environ = NULL; >+ 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); /* path variables */ >+ setclassenvironment(lc, pw, 0); /* non-path variables */ >+ login_close(lc); >+ } >+ if (environ) { >+ /* copy all environment variables that are now set */ >+ env.insert(QProcessEnvironment::systemEnvironment()); >+ } >+ environ = environ_sddm; >+#endif /* defined(Q_OS_FREEBSD) */ > // TODO: I'm fairly sure this shouldn't be done for PAM sessions, investigate! > m_app->session()->setProcessEnvironment(env); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244341
: 211999