From 4ea7dc43fba6621f07dbeac2e16abc98466aa758 Mon Sep 17 00:00:00 2001 From: Juan Hoyos Date: Tue, 10 Aug 2021 19:40:09 -0700 Subject: [PATCH] Fix perms on diagnostic files (#57177) --- src/coreclr/debug/createdump/crashreportwriter.cpp | 4 ++-- src/coreclr/debug/createdump/dumpwriter.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreclr/debug/createdump/crashreportwriter.cpp b/src/coreclr/debug/createdump/crashreportwriter.cpp index 23dd7c2..e72651e 100644 --- a/src/coreclr/debug/createdump/crashreportwriter.cpp +++ b/src/coreclr/debug/createdump/crashreportwriter.cpp @@ -199,7 +199,7 @@ CrashReportWriter::WriteSysctl(const char* sysctlname, const char* valueName) void CrashReportWriter::WriteStackFrame(const StackFrame& frame) -{ +{ OpenObject(); WriteValueBool("is_managed", frame.IsManaged()); WriteValue64("module_address", frame.ModuleAddress()); @@ -252,7 +252,7 @@ CrashReportWriter::WriteStackFrame(const StackFrame& frame) bool CrashReportWriter::OpenWriter(const char* fileName) { - m_fd = open(fileName, O_WRONLY|O_CREAT|O_TRUNC, 0664); + m_fd = open(fileName, O_WRONLY|O_CREAT|O_TRUNC, S_IWUSR | S_IRUSR); if (m_fd == -1) { fprintf(stderr, "Could not create json file %s: %d %s\n", fileName, errno, strerror(errno)); diff --git a/src/coreclr/debug/createdump/dumpwriter.cpp b/src/coreclr/debug/createdump/dumpwriter.cpp index f4532a5..4aa46ac 100644 --- a/src/coreclr/debug/createdump/dumpwriter.cpp +++ b/src/coreclr/debug/createdump/dumpwriter.cpp @@ -23,7 +23,7 @@ DumpWriter::~DumpWriter() bool DumpWriter::OpenDump(const char* dumpFileName) { - m_fd = open(dumpFileName, O_WRONLY|O_CREAT|O_TRUNC, 0664); + m_fd = open(dumpFileName, O_WRONLY|O_CREAT|O_TRUNC, S_IWUSR | S_IRUSR); if (m_fd == -1) { fprintf(stderr, "Could not open output %s: %d %s\n", dumpFileName, errno, strerror(errno)); -- 2.7.4