summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/recursion/main.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-07-11 10:17:59 +0000
committerFangrui Song <maskray@google.com>2019-07-11 10:17:59 +0000
commit6dc59629570ae6fe1836cff3ff53912917d17af7 (patch)
tree163c4166284c232fd4a4b108e7c9a0dba5d32fa9 /lldb/packages/Python/lldbsuite/test/functionalities/recursion/main.cpp
parentf9ca13cb5f05f2a1acce223e794444078584ef0d (diff)
downloadbcm5719-llvm-6dc59629570ae6fe1836cff3ff53912917d17af7.tar.gz
bcm5719-llvm-6dc59629570ae6fe1836cff3ff53912917d17af7.zip
[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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/recursion/main.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud