diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-07-05 18:55:31 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-07-05 18:55:31 +0000 |
commit | 30c34633097c57b0d0f7d4ac02a9847b1b8cd0c3 (patch) | |
tree | f48952d8637ca06c2bd53ec3ddbc4fa8d7bca4a4 /llvm/lib/Support/Unix | |
parent | 77e4c595b0c0bf39c3e5785be5cae8942ea0a5ec (diff) | |
download | bcm5719-llvm-30c34633097c57b0d0f7d4ac02a9847b1b8cd0c3.tar.gz bcm5719-llvm-30c34633097c57b0d0f7d4ac02a9847b1b8cd0c3.zip |
By default mkstemp() creates a temporary file with mode 0600, but the mode
used for open is 0666. Therefore, add the necessary permission bits for
consistency.
rdar://8621462
llvm-svn: 134430
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r-- | llvm/lib/Support/Unix/Path.inc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index 430cf2ed8e8..f295b92e4a5 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -842,6 +842,9 @@ Path::makeUnique(bool reuse_current, std::string* ErrMsg) { // Save the name path = FNBuffer; + + // By default mkstemp sets the mode to 0600, so update mode bits now. + AddPermissionBits (*this, 0666); #elif defined(HAVE_MKTEMP) // If we don't have mkstemp, use the old and obsolete mktemp function. if (mktemp(FNBuffer) == 0) |