浏览代码

CPack: Do not recurse through directory symlinks

Extend the fix from commit 7b8dcdd173 (CPack: Do not recurse through
directory symlinks (#12284), 2011-08-27, v2.8.6~55^2) to more places in
CPack.

Issue: #12284
Brad King 5 年之前
父节点
当前提交
bcc5cd44ed
共有 2 个文件被更改,包括 5 次插入0 次删除
  1. 3 0
      Source/CPack/cmCPackDebGenerator.cxx
  2. 2 0
      Source/CPack/cmCPackGenerator.cxx

+ 3 - 0
Source/CPack/cmCPackDebGenerator.cxx

@@ -484,6 +484,7 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
     findExpr += "/*";
     findExpr += "/*";
     gl.RecurseOn();
     gl.RecurseOn();
     gl.SetRecurseListDirs(true);
     gl.SetRecurseListDirs(true);
+    gl.SetRecurseThroughSymlinks(false);
     if (!gl.FindFiles(findExpr)) {
     if (!gl.FindFiles(findExpr)) {
       cmCPackLogger(cmCPackLog::LOG_ERROR,
       cmCPackLogger(cmCPackLog::LOG_ERROR,
                     "Cannot find any files in the installed directory"
                     "Cannot find any files in the installed directory"
@@ -508,6 +509,7 @@ int cmCPackDebGenerator::PackageOnePack(std::string const& initialTopLevel,
     findExpr += "/*";
     findExpr += "/*";
     gl.RecurseOn();
     gl.RecurseOn();
     gl.SetRecurseListDirs(true);
     gl.SetRecurseListDirs(true);
+    gl.SetRecurseThroughSymlinks(false);
     if (!gl.FindFiles(findExpr)) {
     if (!gl.FindFiles(findExpr)) {
       cmCPackLogger(cmCPackLog::LOG_ERROR,
       cmCPackLogger(cmCPackLog::LOG_ERROR,
                     "Cannot find any files in the installed directory"
                     "Cannot find any files in the installed directory"
@@ -627,6 +629,7 @@ int cmCPackDebGenerator::PackageComponentsAllInOne(
   findExpr += "/*";
   findExpr += "/*";
   gl.RecurseOn();
   gl.RecurseOn();
   gl.SetRecurseListDirs(true);
   gl.SetRecurseListDirs(true);
+  gl.SetRecurseThroughSymlinks(false);
   if (!gl.FindFiles(findExpr)) {
   if (!gl.FindFiles(findExpr)) {
     cmCPackLogger(cmCPackLog::LOG_ERROR,
     cmCPackLogger(cmCPackLog::LOG_ERROR,
                   "Cannot find any files in the installed directory"
                   "Cannot find any files in the installed directory"

+ 2 - 0
Source/CPack/cmCPackGenerator.cxx

@@ -354,6 +354,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
                     "- Install directory: " << top << std::endl);
                     "- Install directory: " << top << std::endl);
       gl.RecurseOn();
       gl.RecurseOn();
       gl.SetRecurseListDirs(true);
       gl.SetRecurseListDirs(true);
+      gl.SetRecurseThroughSymlinks(false);
       if (!gl.FindFiles(findExpr)) {
       if (!gl.FindFiles(findExpr)) {
         cmCPackLogger(cmCPackLog::LOG_ERROR,
         cmCPackLogger(cmCPackLog::LOG_ERROR,
                       "Cannot find any files in the installed directory"
                       "Cannot find any files in the installed directory"
@@ -862,6 +863,7 @@ int cmCPackGenerator::InstallCMakeProject(
     findExpr += "/*";
     findExpr += "/*";
     glB.RecurseOn();
     glB.RecurseOn();
     glB.SetRecurseListDirs(true);
     glB.SetRecurseListDirs(true);
+    glB.SetRecurseThroughSymlinks(false);
     glB.FindFiles(findExpr);
     glB.FindFiles(findExpr);
     filesBefore = glB.GetFiles();
     filesBefore = glB.GetFiles();
     std::sort(filesBefore.begin(), filesBefore.end());
     std::sort(filesBefore.begin(), filesBefore.end());