aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Path.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2024-02-29 08:05:38 -0800
committerGitHub <noreply@github.com>2024-02-29 08:05:38 -0800
commit310ed337092d6afc78594e1d8e32e6f44fff5568 (patch)
tree636e1b707dccfe589d89906f251ab3a212922f18 /llvm/lib/Support/Path.cpp
parent147dc81c1d220a54e9e7d0d4dba7f4b69708ffb7 (diff)
downloadllvm-310ed337092d6afc78594e1d8e32e6f44fff5568.zip
llvm-310ed337092d6afc78594e1d8e32e6f44fff5568.tar.gz
llvm-310ed337092d6afc78594e1d8e32e6f44fff5568.tar.bz2
[Support] Use all_read | all_write for createTemporaryFile (#83360)
In a04879ce7dd6, dsymutil switched from using TempFile to createTemporaryFile. This caused a regression because the two use different permissions: - TempFile opens the file as all_read | all_write - createTemporaryFile opens the file as owner_read | owner_write The latter turns out to be problematic for dsymutil because it either promotes the temporary to a proper output file, or it would pass it to `lipo` to create a universal binary and `lipo` preserves the permissions of the input files. Either way, this caused issues when the build system was run as a different user than the one ingesting the resulting binaries. I did some version control archeology and I couldn't find evidence that these permissions were chosen purposely. Both could be considered reasonable default. This patch changes the permissions to `all read | all write` to make the two consistent and match the one currently used by the higher level abstraction (TempFile). rdar://123722848
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index c8de2c0..acee228 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -850,7 +850,7 @@ createTemporaryFile(const Twine &Model, int &ResultFD,
"Model must be a simple filename.");
// Use P.begin() so that createUniqueEntity doesn't need to recreate Storage.
return createUniqueEntity(P.begin(), ResultFD, ResultPath, true, Type, Flags,
- owner_read | owner_write);
+ all_read | all_write);
}
static std::error_code