From: vsr Date: Thu, 24 Oct 2019 11:33:50 +0000 (+0300) Subject: #17872 [CEA] /tmp/.salome_PortManager.lock permission denied (attempt 2) X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0ff112f5190010a4e6103ffba0ec9fe100d10589;p=modules%2Fyacs.git #17872 [CEA] /tmp/.salome_PortManager.lock permission denied (attempt 2) --- 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)