diff options
author | Brad King <brad.king@kitware.com> | 2020-04-01 14:15:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-04-01 14:15:00 (GMT) |
commit | afe8a5eb3fbedbb66e8411a27b2e9a4dcc325f5f (patch) | |
tree | 06a472dac41ecea824edb6de614b18636f2923fe /Source/kwsys | |
parent | f30526c04ac41e24ce5a1c16f1482498df5c4689 (diff) | |
parent | 976d29b9bd23897f47aa5afd8af621e8970d2b76 (diff) | |
download | CMake-afe8a5eb3fbedbb66e8411a27b2e9a4dcc325f5f.zip CMake-afe8a5eb3fbedbb66e8411a27b2e9a4dcc325f5f.tar.gz CMake-afe8a5eb3fbedbb66e8411a27b2e9a4dcc325f5f.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
KWSys 2020-04-01 (25694819)
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/testSystemTools.cxx | 9 |
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:" |