Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insecure temporary file usage #607

Closed
jrusnack opened this issue Jul 2, 2015 · 7 comments
Closed

Insecure temporary file usage #607

jrusnack opened this issue Jul 2, 2015 · 7 comments

Comments

@jrusnack
Copy link

jrusnack commented Jul 2, 2015

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 gdha added this to the Rear v1.18 milestone Jul 3, 2015
@gdha gdha self-assigned this Jul 3, 2015
@gdha
Copy link
Member

gdha commented Jul 3, 2015

@gdha
Copy link
Member

gdha commented Jul 24, 2015

There are 2 more reports:

@gdha gdha modified the milestones: 1.17.2, Rear v1.18 Jul 24, 2015
gdha added a commit that referenced this issue Jul 24, 2015
- usr/share/rear/finalize/NBU/default/99_copy_bplogrestorelog.sh
- usr/share/rear/restore/DP/default/30_create_dp_restore_fs_list.sh
- usr/share/rear/restore/DP/default/40_restore_with_dp.sh
- usr/share/rear/restore/NBU/default/40_restore_with_nbu.sh
- usr/share/rear/verify/DP/default/45_request_gui_restore.sh
- usr/share/rear/verify/DP/default/50_select_dp_restore.sh
Changed made for :
- https://bugzilla.redhat.com/show_bug.cgi?id=1239009
- https://bugzilla.redhat.com/show_bug.cgi?id=1245189
- https://bugzilla.redhat.com/show_bug.cgi?id=1238843

Related to issue #607
@gdha
Copy link
Member

gdha commented Jul 24, 2015

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

@phracek
Copy link
Contributor

phracek commented Aug 3, 2015

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
Copy link
Contributor

phracek commented Aug 3, 2015

Shall I send you PR for some of these scripts?

gdha added a commit that referenced this issue Aug 3, 2015
/tmp/DP_GUI_RESTORE  => $TMP_DIR/DP_GUI_RESTORE
issue #607
@gdha
Copy link
Member

gdha commented Aug 4, 2015

@phracek An extra PR 👍 fine for me.

@gdha
Copy link
Member

gdha commented Aug 28, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants