[sddm] Fix tty and xdisplay pam settings
Rex Dieter
rdieter at fedoraproject.org
Wed Nov 6 20:01:40 UTC 2013
commit 8fefcb36aee0b819f6b1b32464d167c809c95095
Author: Martin Briza <m at rtinbriza.cz>
Date: Wed Nov 6 20:56:28 2013 +0100
Fix tty and xdisplay pam settings
sddm-auth2.patch | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
sddm.spec | 7 +++-
2 files changed, 96 insertions(+), 1 deletions(-)
---
diff --git a/sddm-auth2.patch b/sddm-auth2.patch
new file mode 100644
index 0000000..1bea83c
--- /dev/null
+++ b/sddm-auth2.patch
@@ -0,0 +1,90 @@
+--- ./sddm-50ca5b20354b6d338ce8836a613af19cedb1dca2/src/auth/AuthenticatorApp.cpp.auth2 2013-11-06 20:54:19.505419712 +0100
++++ ./sddm-50ca5b20354b6d338ce8836a613af19cedb1dca2/src/auth/AuthenticatorApp.cpp 2013-11-06 20:54:28.079461963 +0100
+@@ -158,6 +158,28 @@ namespace SDDM {
+ return true;
+ }
+
++ QString AuthenticatorApp::requestDisplay() {
++ qDebug() << " AUTH: requestDisplay start";
++ QDataStream inStream(&m_input);
++ QDataStream outStream(&m_output);
++ quint32 command = quint32(AuthMessages::AuthNone);
++ qDebug() << " AUTH: Requesting Display";
++ QString display;
++
++ outStream << quint32(AuthMessages::RequestDisplay);
++
++ inStream >> command;
++ if (command != quint32(AuthMessages::Display)) {
++ qDebug() << " AUTH: Received out of order message" << command << "when waiting for SessionID";
++ handleMessage(AuthMessages(command));
++ return display;
++ }
++ inStream >> display;
++
++ qDebug() << " AUTH: requestDisplay end";
++ return display;
++ }
++
+ void AuthenticatorApp::slotLoginFailed() {
+ QDataStream outStream(&m_output);
+ outStream << quint32(AuthMessages::LoginFailed);
+--- ./sddm-50ca5b20354b6d338ce8836a613af19cedb1dca2/src/auth/AuthenticatorApp.h.auth2 2013-11-06 20:54:15.730401120 +0100
++++ ./sddm-50ca5b20354b6d338ce8836a613af19cedb1dca2/src/auth/AuthenticatorApp.h 2013-11-06 20:54:48.392562174 +0100
+@@ -42,6 +42,7 @@ namespace SDDM {
+ QProcessEnvironment requestEnvironment(const QString &user);
+ int requestSessionId();
+ bool requestCookieTo(const QString &path, const QString &user);
++ QString requestDisplay();
+
+ signals:
+ void started(const QString &user, const QString &session, const QString &password, bool passwordless);
+--- ./sddm-50ca5b20354b6d338ce8836a613af19cedb1dca2/src/auth/Method.cpp.auth2 2013-11-06 20:54:12.875387062 +0100
++++ ./sddm-50ca5b20354b6d338ce8836a613af19cedb1dca2/src/auth/Method.cpp 2013-11-06 20:54:29.735470126 +0100
+@@ -100,15 +100,17 @@ namespace SDDM {
+
+ if (!m_pam)
+ return false;
+-/*
++
++ QString display = AuthenticatorApp::instance()->requestDisplay();
++
+ // set tty
+- if (!m_pam->setItem(PAM_TTY, ":0"))
++ if (!m_pam->setItem(PAM_TTY, qPrintable(display)))
+ return false;
+
+ // set display name
+- if (!m_pam->setItem(PAM_XDISPLAY, ":0"))
++ if (!m_pam->setItem(PAM_XDISPLAY, qPrintable(display)))
+ return false;
+-*/
++
+ // set username
+ if (!m_pam->setItem(PAM_USER, qPrintable(m_user)))
+ return false;
+--- ./sddm-50ca5b20354b6d338ce8836a613af19cedb1dca2/src/daemon/Authenticator.cpp.auth2 2013-11-06 20:54:08.851367254 +0100
++++ ./sddm-50ca5b20354b6d338ce8836a613af19cedb1dca2/src/daemon/Authenticator.cpp 2013-11-06 20:54:31.903480815 +0100
+@@ -106,6 +106,9 @@ namespace SDDM {
+ stream << quint32(AuthMessages::CookieLink);
+ break;
+ }
++ case AuthMessages::RequestDisplay:
++ stream << quint32(AuthMessages::Display) << m_display->name();
++ break;
+ default:
+ qWarning() << " DAEMON: Child sent message type" << quint32(command) << "which cannot be handled.";
+ break;
+--- ./sddm-50ca5b20354b6d338ce8836a613af19cedb1dca2/src/common/Messages.h.auth2 2013-11-06 20:54:10.842377053 +0100
++++ ./sddm-50ca5b20354b6d338ce8836a613af19cedb1dca2/src/common/Messages.h 2013-11-06 20:54:34.084491570 +0100
+@@ -51,7 +51,9 @@ namespace SDDM {
+ RequestSessionID,
+ SessionID,
+ RequestCookieLink,
+- CookieLink
++ CookieLink,
++ RequestDisplay,
++ Display
+ };
+
+ enum Capability {
diff --git a/sddm.spec b/sddm.spec
index 0872486..b080f92 100644
--- a/sddm.spec
+++ b/sddm.spec
@@ -3,7 +3,7 @@
Name: sddm
Version: 0.2.0
-Release: 0.19.20130914git%(echo %{sddm_commit} | cut -c-8)%{?dist}
+Release: 0.20.20130914git%(echo %{sddm_commit} | cut -c-8)%{?dist}
# code GPLv2+, fedora theme CC-BY-SA
License: GPLv2+ and CC-BY-SA
Summary: QML based X11 desktop manager
@@ -33,6 +33,7 @@ Patch2: sddm-git.e707e229-session-list.patch
Patch3: sddm-0.2.0-0.11.20130914git50ca5b20-xdmcp.patch
Patch4: sddm-auth.patch
+Patch5: sddm-auth2.patch
Provides: service(graphical-login) = sddm
@@ -76,6 +77,7 @@ A collection of sddm themes, including: circles, elarun, maldives, maui.
%patch2 -p1 -b .session-list
%patch3 -p1 -b .xdmcp
%patch4 -p1 -b .auth
+%patch5 -p2 -b .auth2
# get rid of the architecture flag
sed -i "s/-march=native//" CMakeLists.txt
@@ -148,6 +150,9 @@ install -Dpm 644 %{SOURCE23} %{buildroot}%{_datadir}/apps/sddm/themes/fedora/the
%{_datadir}/apps/sddm/themes/maui/
%changelog
+* Tue Nov 05 2013 Martin Briza <mbriza at redhat.com> - 0.2.0-0.20.20130914git50ca5b20
+- Fix xdisplay and tty vars
+
* Tue Nov 05 2013 Martin Briza <mbriza at redhat.com> - 0.2.0-0.19.20130914git50ca5b20
- Patch cleanup
More information about the scm-commits
mailing list