Skip to content

`FileUtils::joinPathSegmentsNoEscape()`: allow ".." in filenames

Santiago Gil requested to merge santigl/join-path-allow-dots-in-filename into master

Description

FileUtils::joinPathSegmentsNoEscape() will at present error with paths that contain ".." as part of filenames. For example:

"std::runtime_error exception thrown at [buildboxcommon_fileutils.cpp:662], errMsg = "Detected escaping path while joining basedir=[/a/b] and pathWithinBasedir=[c/file..txt]. Resulting escaping path=[/a/b/c/file..txt]."" thrown in the test body.

Changes proposed in this merge request:

  • Change the check for the presence of ".." in the normalized path that detects escapes to look for "../" instead.
  • Add unit tests for paths containing ".."

Merge request reports