From 921358b09692f76469bb19c8eeeeef1305b6d0d9 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Sun, 18 Feb 2024 14:47:34 +0000 Subject: [PATCH] Make instance checker path globally writable On Linux, this directory is shared between users, so a multi-user machine needs to let the other users have access to the directory to create their own lockfiles. --- common/pgm_base.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/pgm_base.cpp b/common/pgm_base.cpp index 5fc3272531..6771980c67 100644 --- a/common/pgm_base.cpp +++ b/common/pgm_base.cpp @@ -492,8 +492,15 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest ) } #endif + // Ensure the instance checker directory exists + // It should be globally writable because it is shared between all users on Linux, and so on a + // multi-user machine, other need to be able to access it to check for the lock files or make + // their own lock files. wxString instanceCheckerDir = PATHS::GetInstanceCheckerPath(); PATHS::EnsurePathExists( instanceCheckerDir ); + wxChmod( instanceCheckerDir, wxPOSIX_USER_READ | wxPOSIX_USER_WRITE | wxPOSIX_USER_EXECUTE | + wxPOSIX_GROUP_READ | wxPOSIX_GROUP_WRITE | wxPOSIX_GROUP_EXECUTE | + wxPOSIX_OTHERS_READ | wxPOSIX_OTHERS_WRITE | wxPOSIX_OTHERS_EXECUTE ); wxString instanceCheckerName = wxString::Format( wxS( "%s-%s" ), pgm_name, GetMajorMinorVersion() );