summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-04-02 15:14:34 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-04-02 15:14:46 (GMT)
commit3667366171afa126b27b7c1ffac237dfcc9a6e15 (patch)
tree5b547d419ce46f249f02de6671a838eef0232613 /Source
parent11d43a7ed627fd874878d386be1321c0ea5ddab2 (diff)
parentafe8a5eb3fbedbb66e8411a27b2e9a4dcc325f5f (diff)
downloadCMake-3667366171afa126b27b7c1ffac237dfcc9a6e15.zip
CMake-3667366171afa126b27b7c1ffac237dfcc9a6e15.tar.gz
CMake-3667366171afa126b27b7c1ffac237dfcc9a6e15.tar.bz2
Merge topic 'update-kwsys'
afe8a5eb3f Merge branch 'upstream-KWSys' into update-kwsys 976d29b9bd KWSys 2020-04-01 (25694819) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4556
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/testSystemTools.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index 670e8dc..aa38aec 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -328,7 +328,14 @@ static bool CheckFileOperations()
}
// While we're at it, check proper TestFileAccess functionality.
- if (kwsys::SystemTools::TestFileAccess(testNewFile,
+ bool do_write_test = true;
+#if defined(__linux__)
+ // If we are running as root on linux ignore this check, as
+ // root can always write to files
+ do_write_test = (getuid() != 0);
+#endif
+ if (do_write_test &&
+ kwsys::SystemTools::TestFileAccess(testNewFile,
kwsys::TEST_FILE_WRITE)) {
std::cerr
<< "TestFileAccess incorrectly indicated that this is a writable file:"