diff options
author | Brad King <brad.king@kitware.com> | 2023-03-08 12:38:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-08 12:38:50 (GMT) |
commit | 81ac174514c1b89cf7a9136af94fe996802fb1b2 (patch) | |
tree | cd4c25c14da50fb7d9196997c70188b51c472ce9 /Source/kwsys | |
parent | 3d6075da4df6a4f93a835e446c2bbf29488f50bd (diff) | |
parent | a87ea777d459462471cfb5a6659e8cb250fb971c (diff) | |
download | CMake-81ac174514c1b89cf7a9136af94fe996802fb1b2.zip CMake-81ac174514c1b89cf7a9136af94fe996802fb1b2.tar.gz CMake-81ac174514c1b89cf7a9136af94fe996802fb1b2.tar.bz2 |
Merge branch 'upstream-KWSys' into file-install-macos
# By KWSys Upstream
* upstream-KWSys:
KWSys 2023-03-08 (a3ff01ab)
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 6cdd5a3..3bb7869 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -2528,6 +2528,12 @@ SystemTools::CopyStatus SystemTools::CloneFileContent( return status; #elif defined(__APPLE__) && \ defined(KWSYS_SYSTEMTOOLS_HAVE_MACOS_COPYFILE_CLONE) + // When running as root, copyfile() copies more metadata than we + // want, such as ownership. Pretend it is not available. + if (getuid() == 0) { + return CopyStatus{ Status::POSIX(ENOSYS), CopyStatus::NoPath }; + } + // NOTE: we cannot use `clonefile` as the {a,c,m}time for the file needs to // be updated by `copy_file_if_different` and `copy_file`. if (copyfile(source.c_str(), destination.c_str(), nullptr, |