Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.1:Update
kinit
0002-Fix-xauth-permissions-race-condition.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-Fix-xauth-permissions-race-condition.patch of Package kinit
From: Albert Astals Cid <aacid@kde.org> Date: Sat, 21 May 2016 15:48:36 +0000 Subject: Fix race in which the file containing the X11 cookie has the wrong permissions for a small while X-Git-Tag: v5.23.0 X-Git-Url: http://quickgit.kde.org/?p=kinit.git&a=commitdiff&h=72f3702dbe6cf15c06dc13da2c99c864e9022a58 --- Fix race in which the file containing the X11 cookie has the wrong permissions for a small while if someone is very fast can watch the file between the open and the setPermissions REVIEW: 127973 Acked-by: mpyne --- --- a/src/kdeinit/kinit.cpp +++ b/src/kdeinit/kinit.cpp @@ -1530,13 +1530,15 @@ + QString::number(getuid()) + QLatin1Char('-') + QString::fromLocal8Bit(display); QSaveFile xauthfile(xauth); QFile xauthfrom(QFile::decodeName(qgetenv("XAUTHORITY"))); + // Set umask to make sure the file permissions of xauthfile are correct + mode_t oldMask = umask(S_IRGRP | S_IROTH | S_IWGRP | S_IWOTH); if (!xauthfrom.open(QFile::ReadOnly) || !xauthfile.open(QFile::WriteOnly) - || !xauthfile.setPermissions(QFile::ReadOwner | QFile::WriteOwner) || xauthfile.write(xauthfrom.readAll()) != xauthfrom.size() || !xauthfile.commit()) { // error } else { qputenv("XAUTHORITY", QFile::encodeName(xauth)); } + umask(oldMask); } }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor