[PATCH] D97253: [llvm-objcopy] If input=output, preserve umask bits, otherwise drop S_ISUID/S_ISGID bits

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 21:34:52 PST 2021


MaskRay created this revision.
MaskRay added reviewers: manojgupta, jcai19, jhenderson.
Herald added subscribers: abrachet, emaste.
Herald added a reviewer: alexshap.
Herald added a reviewer: rupprecht.
MaskRay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This makes the behavior similar to cp

  chmod u+s,g+s,o+x a
  sudo llvm-strip a -o b
  // With this patch, b drops set-user-ID and set-group-ID bits.
  // sudo cp a b => b does not have set-user-ID or set-group-ID bits.

This also changes the behavior for the following case:

  chmod u+s,g+s,o+x a
  llvm-strip a
  // a preserves set-user-ID and set-group-ID bits.
  // This matches binutils<2.36.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97253

Files:
  llvm/test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test
  llvm/test/tools/llvm-objcopy/ELF/mirror-permissions-win.test
  llvm/tools/llvm-objcopy/llvm-objcopy.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97253.325666.patch
Type: text/x-patch
Size: 4297 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210223/8e34c5fb/attachment.bin>


More information about the llvm-commits mailing list