summaryrefslogtreecommitdiffstats
path: root/dcop/client/dcop.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-12-02 23:24:31 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-12-02 23:24:31 +0100
commit38b2b0be7840d868c21093a406ab98a646212de1 (patch)
treec5dde84eeca51ae264fa9cdb62dae0b7564147f0 /dcop/client/dcop.cpp
parent0810a81ba195c1a45c4377aa30f483184e098348 (diff)
downloadtdelibs-38b2b0be7840d868c21093a406ab98a646212de1.tar.gz
tdelibs-38b2b0be7840d868c21093a406ab98a646212de1.zip
Process the new location of the ICEauthority file
+ our internal implementation of IceAuthFileName tests whether the ICEauthority file exists in the folder specified by the XDG_RUNTIME_DIR variable + DCOP client tests whether the ICEauthority file for a specific user exists in the user's folder based on the XDG_RUNTIME_DIR variable + tdeinit uses the IceAuthFileName() function instead of building the file name This relates to bug 3027. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'dcop/client/dcop.cpp')
-rw-r--r--dcop/client/dcop.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/dcop/client/dcop.cpp b/dcop/client/dcop.cpp
index 8aa1ea59d..698479612 100644
--- a/dcop/client/dcop.cpp
+++ b/dcop/client/dcop.cpp
@@ -594,9 +594,29 @@ int runDCOP( QCStringList args, UserList users, Session session,
( getenv( "ICEAUTHORITY" ) == 0 || getenv( "DISPLAY" ) == 0 ) ) )
{
// Check for ICE authority file and if the file can be read by us
- TQString home = it.data();
- TQString iceFile = it.data() + "/.ICEauthority";
- TQFileInfo fi( iceFile );
+ TQString iceFileBase = "ICEauthority";
+ TQString iceFile;
+ TQFileInfo fi;
+
+ if (getenv("XDG_RUNTIME_DIR") != 0 )
+ {
+ TQFileInfo xdgRuntime(getenv("XDG_RUNTIME_DIR"));
+ passwd* pstruct = getpwnam(it.key().local8Bit());
+ if (pstruct)
+ {
+ iceFile = TQString("%1/%2/%3").arg(xdgRuntime.dirPath()).arg(pstruct->pw_uid).arg(iceFileBase);
+ fi.setFile(iceFile);
+ }
+ if (!pstruct || !fi.exists())
+ {
+ iceFile = TQString::null;
+ }
+ }
+ if (iceFile.isEmpty())
+ {
+ iceFile = TQString("%1/.%2").arg(it.data()).arg(iceFileBase);
+ fi.setFile(iceFile);
+ }
if( iceFile.isEmpty() )
{
cerr_ << "WARNING: Cannot determine home directory for user "