]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
#17872 [CEA] /tmp/.salome_PortManager.lock permission denied (attempt 2)
authorvsr <vsr@opencascade.com>
Thu, 24 Oct 2019 11:33:50 +0000 (14:33 +0300)
committervsr <vsr@opencascade.com>
Thu, 24 Oct 2019 11:33:50 +0000 (14:33 +0300)
bin/PortManager.py

index e0584ac81529000f029ad5267f0b1b6a66dbd8b9..9c8974d18ae2a6eb0c48919650fae38b65440394 100644 (file)
@@ -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)