From b49433a75ac4f30ee44ac3cbb069176fa68423bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20B=C5=99=C3=ADza?= Date: Wed, 4 Oct 2017 17:57:48 +0200 Subject: [PATCH] Fix a crash when running sddm as a new user --- 0001-Port-from-xauth-to-libXau.patch | 10 ++++++---- sddm.spec | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/0001-Port-from-xauth-to-libXau.patch b/0001-Port-from-xauth-to-libXau.patch index 219911e..c34b7c4 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,57 @@ namespace SDDM { +@@ -87,28 +88,59 @@ namespace SDDM { } void XorgDisplayServer::addCookie(const QString &file) { @@ -156,14 +156,16 @@ index 7656856..46e7452 100644 + + // open the file + FILE *fp = fopen(qPrintable(file), "w"); -+ if (!fp) ++ if (!fp) { + qWarning() << "Opening the Xauthority file at" << file << "failed"; ++ return; ++ } - // execute xauth - FILE *fp = popen(qPrintable(cmd), "w"); + // write the Xauth data + if (!XauWriteAuth (fp, &auth) || fflush (fp) == EOF) { -+ qCritical() << "Writing the FamilyLocal information to" << file << "failed"; ++ qWarning() << "Writing the FamilyLocal information to" << file << "failed"; + fclose(fp); + return; + } @@ -173,7 +175,7 @@ index 7656856..46e7452 100644 + auth.family = FamilyWild; + + if (!XauWriteAuth (fp, &auth) || fflush (fp) == EOF) { -+ qCritical() << "Writing the FamilyWild information to" << file << "failed"; ++ qWarning() << "Writing the FamilyWild information to" << file << "failed"; + fclose(fp); return; - fprintf(fp, "remove %s\n", qPrintable(m_display)); diff --git a/sddm.spec b/sddm.spec index d5374bd..11fc613 100644 --- a/sddm.spec +++ b/sddm.spec @@ -2,7 +2,7 @@ Name: sddm Version: 0.15.0 -Release: 1%{?dist} +Release: 2%{?dist} # code GPLv2+, fedora theme CC-BY-SA License: GPLv2+ and CC-BY-SA Summary: QML based X11 desktop manager @@ -217,6 +217,9 @@ exit 0 %changelog +* Wed Oct 04 2017 Martin Bříza - 0.15.0-2 +- Fix a crash in the libXau patch (#1492371) + * Mon Sep 04 2017 Rex Dieter - 0.15.0-1 - sddm-0.15.0 (#1487460)