]> git.ipfire.org Git - thirdparty/curl.git/commit
fopen: create new file using old file's mode
authorDaniel Stenberg <daniel@haxx.se>
Thu, 23 Nov 2023 14:52:57 +0000 (15:52 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 23 Nov 2023 21:30:42 +0000 (22:30 +0100)
commit03cb1ff4d629d6110dab787c75c187626d58323d
tree9e09b1f1dd780f710e03f5d284d9e5ab254774df
parent242e6d019f84b012010b89d2009d0188cb66ad30
fopen: create new file using old file's mode

Because the function renames the temp file to the target name as a last
step, if the file was previously owned by a different user, not ORing
the old mode could otherwise end up creating a file that was no longer
readable by the original owner after save.

Reported-by: Loïc Yhuel
Fixes #12299
Closes #12395
CMakeLists.txt
configure.ac
lib/curl_config.h.cmake
lib/fopen.c