Skip to content

Commit 4f16af8

Browse files
committed
affirm our usage of /tmp inside containers
1 parent bd54f6d commit 4f16af8

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

cwltool/command_line_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def job(self,
302302
if runtimeContext.cachedir and enableReuse:
303303
cachecontext = runtimeContext.copy()
304304
cachecontext.outdir = "/out"
305-
cachecontext.tmpdir = "/tmp"
305+
cachecontext.tmpdir = "/tmp" # nosec
306306
cachecontext.stagedir = "/stage"
307307
cachebuilder = self._init_job(job_order, cachecontext)
308308
cachebuilder.pathmapper = PathMapper(cachebuilder.files,

cwltool/docker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,8 @@ def create_runtime(self,
296296
runtime = [u"docker", u"run", u"-i"]
297297
self.append_volume(runtime, os.path.realpath(self.outdir),
298298
self.builder.outdir, writable=True)
299-
self.append_volume(runtime, os.path.realpath(self.tmpdir), "/tmp",
299+
tmpdir = "/tmp" # nosec
300+
self.append_volume(runtime, os.path.realpath(self.tmpdir), tmpdir,
300301
writable=True)
301302
self.add_volumes(self.pathmapper, runtime, any_path_okay=True,
302303
secret_store=runtimeContext.secret_store,

cwltool/process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ def inc(d): # type: (List[int]) -> None
672672
runtime_context.docker_outdir or random_outdir()
673673
elif default_docker is not None:
674674
outdir = runtime_context.docker_outdir or random_outdir()
675-
tmpdir = runtime_context.docker_tmpdir or "/tmp"
675+
tmpdir = runtime_context.docker_tmpdir or "/tmp" # nosec
676676
stagedir = runtime_context.docker_stagedir or "/var/lib/cwl"
677677
else:
678678
outdir = fs_access.realpath(

cwltool/singularity.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,9 @@ def create_runtime(self,
267267
docker_windows_path_adjust(os.path.realpath(self.outdir)),
268268
self.builder.outdir))
269269
runtime.append(u"--bind")
270+
tmpdir = "/tmp" # nosec
270271
runtime.append(u"{}:{}:rw".format(
271-
docker_windows_path_adjust(os.path.realpath(self.tmpdir)), "/tmp"))
272+
docker_windows_path_adjust(os.path.realpath(self.tmpdir)), tmpdir))
272273

273274
self.add_volumes(self.pathmapper, runtime, any_path_okay=True,
274275
secret_store=runtime_context.secret_store,
@@ -288,7 +289,7 @@ def create_runtime(self,
288289
elif runtime_context.disable_net:
289290
runtime.append(u"--net")
290291

291-
env["SINGULARITYENV_TMPDIR"] = "/tmp"
292+
env["SINGULARITYENV_TMPDIR"] = tmpdir
292293
env["SINGULARITYENV_HOME"] = self.builder.outdir
293294

294295
for name, value in self.environment.items():

0 commit comments

Comments
 (0)