diff --git a/0001-Port-from-xauth-to-libXau.patch b/0001-Port-from-xauth-to-libXau.patch index 624c19b..219911e 100644 --- a/0001-Port-from-xauth-to-libXau.patch +++ b/0001-Port-from-xauth-to-libXau.patch @@ -114,7 +114,7 @@ index 7656856..46e7452 100644 #include #include -@@ -87,28 +88,53 @@ namespace SDDM { +@@ -87,28 +88,57 @@ namespace SDDM { } void XorgDisplayServer::addCookie(const QString &file) { @@ -138,11 +138,15 @@ index 7656856..46e7452 100644 + + // set up the auth entry + 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.address = localhost; + auth.address_length = strlen(auth.address); ++ auth.number = displayNumber; ++ auth.number_length = strlen(auth.number); + auth.name = cookieName; -+ auth.name_length = sizeof(cookieName); ++ auth.name_length = strlen(cookieName); + auth.data_length = cookieBinary.count(); + auth.data = cookieBinary.data(); + @@ -203,7 +207,7 @@ diff --git a/src/helper/UserSession.cpp b/src/helper/UserSession.cpp index 587888d..8690cb0 100644 --- a/src/helper/UserSession.cpp +++ b/src/helper/UserSession.cpp -@@ -33,6 +33,9 @@ +@@ -31,6 +31,9 @@ #include #include @@ -213,11 +217,10 @@ index 587888d..8690cb0 100644 namespace SDDM { UserSession::UserSession(HelperApp *parent) : QProcess(parent) { -@@ -170,32 +173,53 @@ namespace SDDM { - QString cookie = qobject_cast(parent())->cookie(); +@@ -169,31 +172,57 @@ if (!cookie.isEmpty()) { QString file = processEnvironment().value(QStringLiteral("XAUTHORITY")); -- QString display = processEnvironment().value(QStringLiteral("DISPLAY")); + QString display = processEnvironment().value(QStringLiteral("DISPLAY")); + Xauth auth = { 0 }; + char localhost[HOST_NAME_MAX + 1] = { 0 }; + @@ -232,11 +235,15 @@ index 587888d..8690cb0 100644 + + // set up the auth entry + 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.address = localhost; + auth.address_length = strlen(auth.address); ++ auth.number = displayNumber; ++ auth.number_length = strlen(auth.number); + auth.name = cookieName; -+ auth.name_length = sizeof(cookieName); ++ auth.name_length = strlen(cookieName); + auth.data_length = cookieBinary.count(); + auth.data = cookieBinary.data(); diff --git a/sddm.spec b/sddm.spec index 8e47607..4174f6c 100644 --- a/sddm.spec +++ b/sddm.spec @@ -2,7 +2,7 @@ Name: sddm Version: 0.14.0 -Release: 13%{?dist} +Release: 14%{?dist} # code GPLv2+, fedora theme CC-BY-SA License: GPLv2+ and CC-BY-SA Summary: QML based X11 desktop manager @@ -225,6 +225,9 @@ exit 0 %changelog +* Fri Aug 25 2017 Martin Bříza - 0.14.0-14 +- Update the libXau patch based on Steve Storey's findings + * Thu Aug 17 2017 Martin Bříza - 0.14.0-13 - Port from xauth to libXau (#1370222)