From 0ff112f5190010a4e6103ffba0ec9fe100d10589 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 24 Oct 2019 14:33:50 +0300 Subject: [PATCH] #17872 [CEA] /tmp/.salome_PortManager.lock permission denied (attempt 2) --- bin/PortManager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/PortManager.py b/bin/PortManager.py index e0584ac81..9c8974d18 100644 --- a/bin/PortManager.py +++ b/bin/PortManager.py @@ -84,10 +84,13 @@ def _getConfigurationFilename(): temp = tempfile.NamedTemporaryFile() lock_file = os.path.join(os.path.dirname(temp.name), ".salome_PortManager.lock") try: + oldmask = os.umask(0) with open(lock_file, 'wb'): pass except IOError: pass + finally: + os.umask(oldmask) temp.close() return (portmanager_config, lock_file) @@ -244,7 +247,7 @@ def releasePort(port): def getBusyPorts(): config_file, lock_file = _getConfigurationFilename() oldmask = os.umask(0) - with open(lock_file, 'wb') as lock: + with open(lock_file, 'rb') as lock: # acquire lock __acquire_lock(lock) -- 2.39.2