[PATCH] D62718: [llvm-objcopy] Change handling of output file permissions

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 23:15:30 PDT 2019


MaskRay added a comment.

In D62718#1551450 <https://reviews.llvm.org/D62718#1551450>, @abrachet wrote:

> I think I agree that 2 is our best option here. I think perhaps overlooked is when reading from stdin we don't know what permissions to assign. What I am working on right now just assigns 0775 (the current default for all output files) I don't know if you would think this is worth checking if the object file is marked as executable or not.
>
> > If it is a block/character special file, you probably don't want to change its permission (think: root does llvm-objcopy something /dev/null).
>
> I'm not sure I understand why this is specifically a problem for 3. Perhaps sys::fs::setPermissions (and other routines in sys::fs:: which modify set permission bits) should be changed to be weary about the file's type, but I don't understand why this is specifically a problem for 3. Seems like a problem for every option including how llvm-objcopy currently does this.


Sorry, the issue about block/character special file is generic, not specific to 3). Let's see what other reviewers think.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62718/new/

https://reviews.llvm.org/D62718





More information about the llvm-commits mailing list