From 6f7c5387e8dc2e7888afb9f8b314a7e2c5f0f387 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 8 Sep 2015 18:22:10 +0300 Subject: [PATCH] Port manager's lock file should be created with proper permissions; we must use umask command in all related functions. --- bin/PortManager.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/PortManager.py b/bin/PortManager.py index 518b4eed9..f1641bdb6 100644 --- a/bin/PortManager.py +++ b/bin/PortManager.py @@ -165,6 +165,7 @@ def releasePort(port): logger.debug("RELEASE PORT (%s)"%port) config_file, lock_file = _getConfigurationFilename() + oldmask = os.umask(0) with open(lock_file, 'w') as lock: # acquire lock __acquire_lock(lock) @@ -199,10 +200,14 @@ def releasePort(port): __release_lock(lock) logger.debug("released port port: %s"%str(port)) + + os.umask(oldmask) # def getBusyPorts(): + busy_ports = [] config_file, lock_file = _getConfigurationFilename() + oldmask = os.umask(0) with open(lock_file, 'w') as lock: # acquire lock __acquire_lock(lock) @@ -222,5 +227,6 @@ def getBusyPorts(): # release lock __release_lock(lock) - return busy_ports + os.umask(oldmask) + return busy_ports # -- 2.39.2