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

Cleanup test File utilities #1989

Merged
merged 3 commits into from
Nov 13, 2024
Merged

Cleanup test File utilities #1989

merged 3 commits into from
Nov 13, 2024

Conversation

justsmth
Copy link
Contributor

Issues:

Addresses: P168988559

Description of changes:

  • Only use move semantic for TemporaryFile and ScopedFD.
  • Set umask prior to creating temporary file.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@codecov-commenter
Copy link

codecov-commenter commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.88%. Comparing base (096f73a) to head (d70832d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1989      +/-   ##
==========================================
+ Coverage   78.86%   78.88%   +0.02%     
==========================================
  Files         593      593              
  Lines      101934   101935       +1     
  Branches    14450    14450              
==========================================
+ Hits        80386    80408      +22     
+ Misses      20904    20881      -23     
- Partials      644      646       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@justsmth justsmth marked this pull request as ready for review November 13, 2024 15:45
@justsmth justsmth requested a review from a team as a code owner November 13, 2024 15:45
@@ -122,7 +122,9 @@ bool TemporaryFile::Init(bssl::Span<const uint8_t> content) {
#else
std::string path = temp_dir + "bssl_tmp_file.XXXXXX";
// TODO(davidben): Use |path.data()| when we require C++17.
mode_t prev_umask = umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
Copy link
Contributor

Choose a reason for hiding this comment

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

Where did this mask come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This particular just ensures that Read/Write permissions for "group" and "others" will not be granted when the file is created. (Typically, created files allow others to read.) https://man7.org/linux/man-pages/man2/umask.2.html

@justsmth justsmth merged commit 9d702ec into aws:main Nov 13, 2024
114 of 116 checks passed
@justsmth justsmth deleted the cleanup-file-util branch November 13, 2024 22:02
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.

4 participants