#607 Issue closed: Insecure temporary file usage

Labels: enhancement, fixed / solved / done

jrusnack opened issue at 2015-07-02 14:23:

Simply grepping for /tmp in source code gives a lot of hits, some of which are dangerous, e.g.:

usr/share/rear/verify/DP/default/50_select_dp_restore.sh:

test -f /tmp/dp_list_of_sessions.in && rm -f /tmp/dp_list_of_sessions.in

Would be nice if all occurences of hardcoded /tmp/.. were replaced with using mktemp.

gdha commented at 2015-07-03 09:13:

See RH Bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1239009

gdha commented at 2015-07-24 09:33:

There are 2 more reports:

gdha commented at 2015-07-24 12:20:

remark: RH Bugzilla 1245189 has been closed as it is duplicate of 1239009 (fedora 22).

phracek commented at 2015-08-03 11:56:

I have a question related to this issue.
I have found that $TMP_DIR is setup by usr/bin/rear binary via mktemp -d -t command line.
I have found that there are other binaries/scripts which have still /tmp definitions.
Like:
share/rear/output/TSM/default/95_dsmc_save_result_files.sh [12]
share/rear/output/NSR/default/95_nsr_save_result_files.sh [12]
share/rear/lib/validate-workflow.sh [118,121]
share/rear/finalize/GNU/Linux/16_rename_diskbyid.sh [23]
share/rear/rescue/default/91_copy_logfile.sh [3] ???

phracek commented at 2015-08-03 11:56:

Shall I send you PR for some of these scripts?

gdha commented at 2015-08-04 14:41:

@phracek An extra PR 👍 fine for me.

gdha commented at 2015-08-28 13:07:

@phracek I believe we have fixed all /tmp/ related stuff in rear 1.17.2 - I will make a release beginning of next week


[Export of Github issue for rear/rear.]