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

fix: Refactor OpenDestination func #400

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

Gofastasf
Copy link
Contributor

  • Replaced os.Stat call and os.Create with os.OpenFile with O_EXCL to avoid TOCTOU.
  • Improved logic to handle file size check only when the file exists.

@Gofastasf Gofastasf force-pushed the fix/OpenDestination-func branch from 45b9602 to 63219da Compare February 2, 2025 19:16
- Replaced os.Stat call and os.Create with os.OpenFile with O_EXCL to avoid TOCTOU.
- Improved logic to handle file size check only when the file exists.

Signed-off-by: Gofastasf <[email protected]>
@Gofastasf Gofastasf force-pushed the fix/OpenDestination-func branch from 63219da to db5e7e1 Compare February 2, 2025 19:32
Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

another nice cleanup, thank you @Gofastasf :)

@jaypipes jaypipes merged commit 7e034f0 into jaypipes:main Feb 3, 2025
12 checks passed
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