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

Jian Cai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 19:24:36 PST 2021


jcai19 added inline comments.


================
Comment at: llvm/lib/Support/FileOutputBuffer.cpp:142
+    if (!EC)
+      fs::changeFileOwnership(File.TmpName, Stat.getUser(), Stat.getGroup());
+  }
----------------
manojgupta wrote:
> 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. 
Yes, I realized it the moment I sent the update. Will fix it.


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