Fix a crash when running sddm as a new user

epel9
Martin Bříza 7 years ago
parent 67221b6842
commit b49433a75a

@ -114,7 +114,7 @@ index 7656856..46e7452 100644
#include <pwd.h>
#include <unistd.h>
@@ -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));

@ -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 <mbriza@redhat.com> - 0.15.0-2
- Fix a crash in the libXau patch (#1492371)
* Mon Sep 04 2017 Rex Dieter <rdieter@fedoraproject.org> - 0.15.0-1
- sddm-0.15.0 (#1487460)

Loading…
Cancel
Save