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 <pwd.h>
#include <unistd.h> #include <unistd.h>
@@ -87,28 +88,57 @@ namespace SDDM { @@ -87,28 +88,59 @@ namespace SDDM {
} }
void XorgDisplayServer::addCookie(const QString &file) { void XorgDisplayServer::addCookie(const QString &file) {
@ -156,14 +156,16 @@ index 7656856..46e7452 100644
+ +
+ // open the file + // open the file
+ FILE *fp = fopen(qPrintable(file), "w"); + FILE *fp = fopen(qPrintable(file), "w");
+ if (!fp) + if (!fp) {
+ qWarning() << "Opening the Xauthority file at" << file << "failed"; + qWarning() << "Opening the Xauthority file at" << file << "failed";
+ return;
+ }
- // execute xauth - // execute xauth
- FILE *fp = popen(qPrintable(cmd), "w"); - FILE *fp = popen(qPrintable(cmd), "w");
+ // write the Xauth data + // write the Xauth data
+ if (!XauWriteAuth (fp, &auth) || fflush (fp) == EOF) { + 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); + fclose(fp);
+ return; + return;
+ } + }
@ -173,7 +175,7 @@ index 7656856..46e7452 100644
+ auth.family = FamilyWild; + auth.family = FamilyWild;
+ +
+ if (!XauWriteAuth (fp, &auth) || fflush (fp) == EOF) { + 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); + fclose(fp);
return; return;
- fprintf(fp, "remove %s\n", qPrintable(m_display)); - fprintf(fp, "remove %s\n", qPrintable(m_display));

@ -2,7 +2,7 @@
Name: sddm Name: sddm
Version: 0.15.0 Version: 0.15.0
Release: 1%{?dist} Release: 2%{?dist}
# code GPLv2+, fedora theme CC-BY-SA # code GPLv2+, fedora theme CC-BY-SA
License: GPLv2+ and CC-BY-SA License: GPLv2+ and CC-BY-SA
Summary: QML based X11 desktop manager Summary: QML based X11 desktop manager
@ -217,6 +217,9 @@ exit 0
%changelog %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 * Mon Sep 04 2017 Rex Dieter <rdieter@fedoraproject.org> - 0.15.0-1
- sddm-0.15.0 (#1487460) - sddm-0.15.0 (#1487460)

Loading…
Cancel
Save