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

curl -D headerfile to use append only operations #10224

Closed
wants to merge 1 commit into from

Conversation

icing
Copy link
Contributor

@icing icing commented Jan 4, 2023

Fix headerfile writing in the curl tool to not rely on the first transfer started to be the first to get a response.

All transfers now write the headefile (-D) in append mode, making sure that the order of transfer responses does not lead to overwrites of previous data.

…sfer started to be the first to get a response.

All transfers now write the headefile (-D) in append mode, making sure that the order of transfer
responses does not lead to overwrites of previous data.
newfile = fopen(config->headerfile, "wb+");
fclose(newfile);
}
newfile = fopen(config->headerfile, "ab+");

Check failure

Code scanning / CodeQL

File created without restricting permissions

A file may be created here with mode 0666, which would make it world-writable.
@bagder
Copy link
Member

bagder commented Jan 4, 2023

Thanks!

@bagder bagder closed this in 24e4e57 Jan 4, 2023
bch pushed a commit to bch/curl that referenced this pull request Jul 19, 2023
Do not rely on the first transfer started to be the first to get a
response (remember -Z). All transfers now write the headefile (-D) in
append mode, making sure that the order of transfer responses does not
lead to overwrites of previous data.

Closes curl#10224
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants