Skip to content

Commit 55dc851

Browse files
vladakVladimir Kotal
authored andcommitted
change current working directory to root before proceeding
1 parent 03ae44b commit 55dc851

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/sync/sync.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ def worker(base):
144144
pass
145145
logger.debug("Ignored projects: {}".format(ignore_errors))
146146

147+
try:
148+
os.chdir("/")
149+
except OSError as e:
150+
logger.error("cannot change working directory to /",
151+
exc_info=True)
152+
sys.exit(1)
153+
147154
lock = filelock.FileLock(os.path.join(tempfile.gettempdir(),
148155
"opengrok-sync.lock"))
149156
try:

0 commit comments

Comments
 (0)