From ed93cf0e084d52ca58c8a966fa9506af4484a8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Wed, 27 Nov 2019 17:57:36 +0100 Subject: [PATCH] ksmserver: Use the IceAuthFileName() function instead of building the file name. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This relates to bug 3027. Signed-off-by: Slávek Banko --- ksmserver/main.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ksmserver/main.cpp b/ksmserver/main.cpp index 1004c4394..977ba02e0 100644 --- a/ksmserver/main.cpp +++ b/ksmserver/main.cpp @@ -99,14 +99,10 @@ void sanity_check( int argc, char* argv[] ) } if (msg.isEmpty()) { - path = getenv("ICEAUTHORITY"); + path = IceAuthFileName(); if (path.isEmpty()) - { - path = getenv("HOME"); - path += "/.ICEauthority"; - } - - if (access(path.data(), W_OK) && (errno != ENOENT)) + msg = "Unable to determine path for ICEauthority file."; + else if (access(path.data(), W_OK) && (errno != ENOENT)) msg = "No write access to '%s'."; else if (access(path.data(), R_OK) && (errno != ENOENT)) msg = "No read access to '%s'.";