|
|
@ -114,7 +114,7 @@ index 7656856..46e7452 100644
|
|
|
|
|
|
|
|
|
|
|
|
#include <pwd.h>
|
|
|
|
#include <pwd.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
@@ -87,28 +88,53 @@ namespace SDDM {
|
|
|
|
@@ -87,28 +88,57 @@ namespace SDDM {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void XorgDisplayServer::addCookie(const QString &file) {
|
|
|
|
void XorgDisplayServer::addCookie(const QString &file) {
|
|
|
@ -138,11 +138,15 @@ index 7656856..46e7452 100644
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // set up the auth entry
|
|
|
|
+ // set up the auth entry
|
|
|
|
+ char cookieName[] = "MIT-MAGIC-COOKIE-1";
|
|
|
|
+ char cookieName[] = "MIT-MAGIC-COOKIE-1";
|
|
|
|
|
|
|
|
+ char displayNumber[m_display.size() + 1] = { 0 };
|
|
|
|
|
|
|
|
+ strcpy(displayNumber, qPrintable(m_display.mid(1))); // Need to skip the ':'
|
|
|
|
+ auth.family = FamilyLocal;
|
|
|
|
+ auth.family = FamilyLocal;
|
|
|
|
+ auth.address = localhost;
|
|
|
|
+ auth.address = localhost;
|
|
|
|
+ auth.address_length = strlen(auth.address);
|
|
|
|
+ auth.address_length = strlen(auth.address);
|
|
|
|
|
|
|
|
+ auth.number = displayNumber;
|
|
|
|
|
|
|
|
+ auth.number_length = strlen(auth.number);
|
|
|
|
+ auth.name = cookieName;
|
|
|
|
+ auth.name = cookieName;
|
|
|
|
+ auth.name_length = sizeof(cookieName);
|
|
|
|
+ auth.name_length = strlen(cookieName);
|
|
|
|
+ auth.data_length = cookieBinary.count();
|
|
|
|
+ auth.data_length = cookieBinary.count();
|
|
|
|
+ auth.data = cookieBinary.data();
|
|
|
|
+ auth.data = cookieBinary.data();
|
|
|
|
+
|
|
|
|
+
|
|
|
@ -203,7 +207,7 @@ diff --git a/src/helper/UserSession.cpp b/src/helper/UserSession.cpp
|
|
|
|
index 587888d..8690cb0 100644
|
|
|
|
index 587888d..8690cb0 100644
|
|
|
|
--- a/src/helper/UserSession.cpp
|
|
|
|
--- a/src/helper/UserSession.cpp
|
|
|
|
+++ b/src/helper/UserSession.cpp
|
|
|
|
+++ b/src/helper/UserSession.cpp
|
|
|
|
@@ -33,6 +33,9 @@
|
|
|
|
@@ -31,6 +31,9 @@
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
|
|
|
|
|
@ -213,11 +217,10 @@ index 587888d..8690cb0 100644
|
|
|
|
namespace SDDM {
|
|
|
|
namespace SDDM {
|
|
|
|
UserSession::UserSession(HelperApp *parent)
|
|
|
|
UserSession::UserSession(HelperApp *parent)
|
|
|
|
: QProcess(parent) {
|
|
|
|
: QProcess(parent) {
|
|
|
|
@@ -170,32 +173,53 @@ namespace SDDM {
|
|
|
|
@@ -169,31 +172,57 @@
|
|
|
|
QString cookie = qobject_cast<HelperApp*>(parent())->cookie();
|
|
|
|
|
|
|
|
if (!cookie.isEmpty()) {
|
|
|
|
if (!cookie.isEmpty()) {
|
|
|
|
QString file = processEnvironment().value(QStringLiteral("XAUTHORITY"));
|
|
|
|
QString file = processEnvironment().value(QStringLiteral("XAUTHORITY"));
|
|
|
|
- QString display = processEnvironment().value(QStringLiteral("DISPLAY"));
|
|
|
|
QString display = processEnvironment().value(QStringLiteral("DISPLAY"));
|
|
|
|
+ Xauth auth = { 0 };
|
|
|
|
+ Xauth auth = { 0 };
|
|
|
|
+ char localhost[HOST_NAME_MAX + 1] = { 0 };
|
|
|
|
+ char localhost[HOST_NAME_MAX + 1] = { 0 };
|
|
|
|
+
|
|
|
|
+
|
|
|
@ -232,11 +235,15 @@ index 587888d..8690cb0 100644
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // set up the auth entry
|
|
|
|
+ // set up the auth entry
|
|
|
|
+ char cookieName[] = "MIT-MAGIC-COOKIE-1";
|
|
|
|
+ char cookieName[] = "MIT-MAGIC-COOKIE-1";
|
|
|
|
|
|
|
|
+ char displayNumber[display.size() + 1] = { 0 };
|
|
|
|
|
|
|
|
+ strcpy(displayNumber, qPrintable(display.mid(1))); // Need to skip the ':'
|
|
|
|
+ auth.family = FamilyLocal;
|
|
|
|
+ auth.family = FamilyLocal;
|
|
|
|
+ auth.address = localhost;
|
|
|
|
+ auth.address = localhost;
|
|
|
|
+ auth.address_length = strlen(auth.address);
|
|
|
|
+ auth.address_length = strlen(auth.address);
|
|
|
|
|
|
|
|
+ auth.number = displayNumber;
|
|
|
|
|
|
|
|
+ auth.number_length = strlen(auth.number);
|
|
|
|
+ auth.name = cookieName;
|
|
|
|
+ auth.name = cookieName;
|
|
|
|
+ auth.name_length = sizeof(cookieName);
|
|
|
|
+ auth.name_length = strlen(cookieName);
|
|
|
|
+ auth.data_length = cookieBinary.count();
|
|
|
|
+ auth.data_length = cookieBinary.count();
|
|
|
|
+ auth.data = cookieBinary.data();
|
|
|
|
+ auth.data = cookieBinary.data();
|
|
|
|
|
|
|
|
|
|
|
|