Преглед изворни кода

KWSys 2023-11-29 (433f3d23)

Code extracted from:

    https://gitlab.kitware.com/utils/kwsys.git

at commit 433f3d23ffa37f8fa6dd42468933f36c28a9e7fa (master).

Upstream Shortlog
-----------------

Brad King (1):
      9f9ff427 SystemTools: Teach RemoveADirectory to handle non-readable directories
KWSys Upstream пре 2 година
родитељ
комит
22a759b5b5
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4 4
      SystemTools.cxx

+ 4 - 4
SystemTools.cxx

@@ -2794,14 +2794,14 @@ Status SystemTools::RemoveFile(std::string const& source)
 
 Status SystemTools::RemoveADirectory(std::string const& source)
 {
-  // Add write permission to the directory so we can modify its
-  // content to remove files and directories from it.
+  // Add read and write permission to the directory so we can read
+  // and modify its content to remove files and directories from it.
   mode_t mode = 0;
   if (SystemTools::GetPermissions(source, mode)) {
 #if defined(_WIN32) && !defined(__CYGWIN__)
-    mode |= S_IWRITE;
+    mode |= S_IREAD | S_IWRITE;
 #else
-    mode |= S_IWUSR;
+    mode |= S_IRUSR | S_IWUSR;
 #endif
     SystemTools::SetPermissions(source, mode);
   }