mirror of https://github.com/BOINC/boinc.git
start script: create lock and pid files non-world-writeable
This commit is contained in:
parent
e93e436b5a
commit
1274dbe2cb
|
@ -284,7 +284,7 @@ def double_fork():
|
||||||
|
|
||||||
# Decouple from parent environment.
|
# Decouple from parent environment.
|
||||||
os.chdir("/")
|
os.chdir("/")
|
||||||
os.umask(0)
|
os.umask(02)
|
||||||
os.setsid()
|
os.setsid()
|
||||||
|
|
||||||
# Do second fork.
|
# Do second fork.
|
||||||
|
@ -312,6 +312,7 @@ def is_pid_running(pid):
|
||||||
locks = []
|
locks = []
|
||||||
def lock_file(filename):
|
def lock_file(filename):
|
||||||
global locks
|
global locks
|
||||||
|
os.umask(02)
|
||||||
file = open(filename,'w')
|
file = open(filename,'w')
|
||||||
locks.append(file)
|
locks.append(file)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue