summaryrefslogtreecommitdiff
path: root/spec/unit/file_system/path_pattern_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2013-08-06(maint) Fix windows test for embedded '..' in pathJosh Partlow1-4/+4
Was calling relative with an absolute url. Moved to the absolute section.
2013-08-06(#21971) Allow paths that contain .. as part of a nameJosh Partlow1-0/+16
The PathPattern code was incorrectly flagging paths like /tmp/foo..bar as being directory traversals. This updates that to exclude those names by checking each path component separately instead of looking at the path as a whole. In addition this fixes up the error reporting about these kinds of errors in Puppet::Module by creating the absolute PathPattern for the manifests directory of the module at initialization time, so that any errors from it are not swallowed by the error handling for the relative path searching of manifests. This also removed some duplicate handling of init.pp and init.rb where in the case of having no pattern to search for the init files were returned twice and also seemed to be loaded twice. This does not remove the behavior in which the init.pp and rb files are *always* returned when they exist, because that seems to be explicit behavior added for issue #4220.
2013-08-06(#21971) Create system for safely dealing with path patternsAndrew Parker1-0/+122
Correctly checking that a given string is safe to use for looking for files on the filesystem is tricky. This adds a class called Puppet::FileSystem::PathPattern that encapsulates a validated path pattern free of defects such as directory traversal '..' entries and zero byte delimeters. This is then used to protect finding manifest files in modules.