Go to file
Fangrui Song 6dc5962957 [llvm-objcopy] Don't change permissions of non-regular output files
There is currently an EPERM error when a regular user executes `llvm-objcopy a.o /dev/null`.
Worse, root can even change the mode bits of /dev/null.

Fix it by checking if the output file is special.

A new overload of llvm::sys::fs::setPermissions with FD as the parameter
is added. Users should provide `perm & ~umask` as the parameter if they
intend to respect umask.

The existing overload of llvm::sys::fs::setPermissions may be deleted if
we can find an implementation of fchmod() on Windows. fchmod() is
usually better than chmod() because it saves syscalls and can avoid race
condition.

Reviewed By: jakehehrlich, jhenderson

Differential Revision: https://reviews.llvm.org/D64236

llvm-svn: 365753
2019-07-11 10:17:59 +00:00
clang Revert Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the Option class." 2019-07-11 08:54:28 +00:00
clang-tools-extra [clangd] Add a missing "return nullptr;" to the SelectionTree::commonAncestor. 2019-07-11 10:06:24 +00:00
compiler-rt [ASan] Use __sanitizer_fill_shadow for FastPoisonShadow on Fuchsia 2019-07-11 07:30:11 +00:00
debuginfo-tests Make nrvo-string test more robust. 2019-06-27 20:38:37 +00:00
libclc travis: Add LLVM-8 build 2019-03-27 21:28:31 +00:00
libcxx build: use multiple `install` rather than building up a list 2019-07-09 21:43:01 +00:00
libcxxabi [demangle] Support for C++2a char8_t 2019-06-28 19:54:19 +00:00
libunwind [libunwind] Fix Unwind-EHABI.cpp:getByte on big-endian targets 2019-07-09 15:29:06 +00:00
lld Fix build breakage on Win32. 2019-07-11 06:56:44 +00:00
lldb [lldb] Disable TestDollarInVariable.py on Windows 2019-07-11 00:35:31 +00:00
llgo IR: Support parsing numeric block ids, and emit them in textual output. 2019-03-22 18:27:13 +00:00
llvm [llvm-objcopy] Don't change permissions of non-regular output files 2019-07-11 10:17:59 +00:00
openmp NFC: fixed typo #ifdef --> #if to allow macro set to 0 work correctly 2019-07-10 15:09:37 +00:00
parallel-libs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
polly OpaquePtr: Update polly's calls to Loads.h API 2019-07-09 12:13:31 +00:00
pstl [NFC][pstl] Remove unused utility code 2019-07-08 16:35:49 +00:00
.arcconfig Update monorepo .arcconfig with new project callsign. 2019-01-31 14:34:59 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
.gitignore Add a reduced copy of the llvm .gitignore 2019-04-09 00:52:49 +00:00
README.md

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.