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

Use a mktemp random directory for installation (repeated PR) #301

Merged
merged 3 commits into from
Jan 8, 2022

Conversation

keymon
Copy link
Contributor

@keymon keymon commented Aug 16, 2021

Reissuing the PR #269 closed by stale bot
Updated with master

Do not hardcode a static directory for temporary files, as it
might cause problems when running in a multi-user system
(ie: orphan files owned by other users).

Use mktemp -d instead.

Fixes #241
This was already tested in #269

Copy link

@ohartl ohartl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rmTempDir is a nice addition for cleanup, but a call to that at the end seems to be missing. Thus temp files are only cleaned up in case of a failure currently. Or is fail_trap naming wrong?

@stale
Copy link

stale bot commented Nov 16, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 16, 2021
@keymon
Copy link
Contributor Author

keymon commented Nov 16, 2021

It is not stale, it is just not getting attention. Needs merging :)

@stale stale bot removed the stale label Nov 16, 2021
@keymon
Copy link
Contributor Author

keymon commented Nov 16, 2021

rmTempDir is a nice addition for cleanup, but a call to that at the end seems to be missing. Thus temp files are only cleaned up in case of a failure currently. Or is fail_trap naming wrong?

yep, the trap is on EXIT, so it will be always executed.

Maybe exit_trap is a better name

@ohartl
Copy link

ohartl commented Dec 2, 2021

rmTempDir is a nice addition for cleanup, but a call to that at the end seems to be missing. Thus temp files are only cleaned up in case of a failure currently. Or is fail_trap naming wrong?

yep, the trap is on EXIT, so it will be always executed.

Maybe exit_trap is a better name

Sorry I was confused there for a second, thanks for clearing that up.

Its now not only waiting for a failure anymore, so naming is bit wrong. I think exit_trap is nice! But removing the dir in in a trap is nice.

Do not hardcode a static directory for temporary files, as it
might cause problems when running in a multi-user system
(ie: orphan files owned by other users).

Use mktemp -d instead.

Fixes databus23#241
@keymon keymon force-pushed the plugin-install-mktemp branch from f4351b3 to a457651 Compare December 2, 2021 14:30
@keymon
Copy link
Contributor Author

keymon commented Dec 2, 2021

@ohartl OK, I rebased and renamed the function

@ohartl
Copy link

ohartl commented Dec 18, 2021

@databus23 Needs merging

Copy link
Collaborator

@mumoshu mumoshu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks a lot for your contribution ☺️

@mumoshu mumoshu merged commit ff9fe31 into databus23:master Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to create the file /tmp/helm-diff.tgz: Permission denied
3 participants