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

sh script's STAMPFILE loses mktemp safety #666

Open
MAProsper opened this issue May 24, 2024 · 0 comments
Open

sh script's STAMPFILE loses mktemp safety #666

MAProsper opened this issue May 24, 2024 · 0 comments

Comments

@MAProsper
Copy link

MAProsper commented May 24, 2024

mktemp guaranties to create the STAMPFILE without clobbering other files. However the file gets deleted and manually created with touch in the remove_cmd function, losing it uniqueness guaranties.

This could be fix by calling rm -f "$STAMPFILE" at the end of the script and not remove it in remove_cmd. This also has the benefit of being more performant (since the file is not recreated constantly) and also it ensures that the stamp file is always deleted (even if remove_cmd is not called).

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

No branches or pull requests

1 participant