Skip to content

temp files: inherit permissions only for owner - #21092

Closed
icing wants to merge 1 commit into
curl:masterfrom
icing:temp-file-permissions
Closed

icing wants to merge 1 commit into
curl:masterfrom
icing:temp-file-permissions

Conversation

@icing

@icing icing commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

When creating a temp file in order to later replace an original, copying over the existing permissions can not be considered safe when the user running libcurl is not the owner of the existing file.

When creating a temp file in order to later replace an original, copying
over the existing permissions can not be considered safe when the user
running libcurl is not the owner of the existing file.
@icing

icing commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

This could cause breakage in some weird use cases where different uid processes try to manage a shared resource file. It sounds like a strange operation mode, though. But applications have been known to be "inventive" in the past...

Comment thread lib/curl_fopen.c Resolved
@bagder bagder closed this in 8deaf04 Mar 30, 2026
dkarpov1970 pushed a commit to dkarpov1970/curl that referenced this pull request Apr 7, 2026
When creating a temp file in order to later replace an original, copying
over the existing permissions can not be considered safe when the user
running libcurl is not the owner of the existing file.

Closes curl#21092
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
When creating a temp file in order to later replace an original, copying
over the existing permissions can not be considered safe when the user
running libcurl is not the owner of the existing file.

Closes curl#21092
@hwti

hwti commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This basically reverts 03cb1ff (but only checking the user, not the group).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants