Skip to content
Snippets Groups Projects
Commit 81c9629c authored by Zach Marshall's avatar Zach Marshall Committed by Edward Moyse
Browse files

Patch to get_files to use mktemp

Patch to get_files to use mktemp

As suggested in ATEAM-858, patching get_files to use mktemp. Seems to be
working in a few local tests, and seems to be a well-supported command.
This avoids making use of /tmp in systems that might not have /tmp and
might not have set $TMPDIR (e.g. might have set $TEMPDIR, or might use
some other path for temporary files).
parent e5cc4393
No related branches found
No related tags found
No related merge requests found
......@@ -167,9 +167,8 @@ basic_copycmd="cp -f -L -R"
basic_linkcmd="ln -s -f -n"
copycmd=${basic_copycmd}
# Add 'exit' here to make script interruptable; do not trap signal 0.
if [ -z "$TMPDIR" ]; then tempfile="/tmp/getfile_$$"
else tempfile="$TMPDIR/getfile_$$"; fi
# Add 'exit' here to make script clean up on interrupt; do not trap signal 0.
tempfile=$(mktemp -u)
trap '/bin/rm -f ${tempfile}; exit 1' 1 2 15
/bin/rm -f ${tempfile}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment