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

Create a tmp directory for record and report #231

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Conversation

janaknat
Copy link
Contributor

This uses the TempDir crate to generate unique temp directories for aperf runs. Also, move to using references where possible for the Data trait.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@janaknat janaknat requested a review from a team as a code owner September 12, 2024 18:13
Also, move to using references where possible for the Data trait.
let tmp_dir = TempBuilder::new()
.prefix("aperf-tmp-")
.tempdir_in(&cli.tmp_dir)?;
fs::set_permissions(&tmp_dir, fs::Permissions::from_mode(0o1777))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

The previous code was setting only 0o777, not 0o1777. Technically the 1 seems right for a directory, but it wasn't necessary before. Did something change, or did you notice some problem with what was happening before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The 1 sets the sticky bit which is required to prevent users who have access to this dir from deleting the dir.

@janaknat janaknat merged commit bc0fa31 into main Sep 13, 2024
6 checks passed
@janaknat janaknat deleted the tmp-dir-update branch September 17, 2024 14:53
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.

2 participants