[PATCH] D93881: [llvm-objcopy] preserve file ownership when overwritten

Manoj Gupta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 19:23:36 PST 2021


manojgupta added inline comments.


================
Comment at: llvm/lib/Support/FileOutputBuffer.cpp:142
+    if (!EC)
+      fs::changeFileOwnership(File.TmpName, Stat.getUser(), Stat.getGroup());
+  }
----------------
manojgupta wrote:
> Can we pass the file descriptor (File.FD) directly?
The check for root user looks incorrect to me. The stat check for root should be done on the temp file, not the existing file. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93881



More information about the llvm-commits mailing list