diff --git a/internal/sympath/walk.go b/internal/sympath/walk.go index 4cffe1b23..a1dabba82 100644 --- a/internal/sympath/walk.go +++ b/internal/sympath/walk.go @@ -68,13 +68,14 @@ func symwalk(path string, info os.FileInfo, walkFn filepath.WalkFunc) error { resolved, err := filepath.EvalSymlinks(path) if err != nil { log.Printf("Skipping broken symlink: %s", path) // Log broken symlink - return nil // Skip this symlink and continue + return nil } - log.Printf("Found symbolic link in path: %s resolves to %s. Contents of linked file included and used", path, resolved) + //This log message is to highlight a symlink that is being used within a chart, symlinks can be used for nefarious reasons. + log.Printf("found symbolic link in path: %s resolves to %s. Contents of linked file included and used", path, resolved) if info, err = os.Lstat(resolved); err != nil { return err } - if err := symwalk(path, info, walkFn); err != nil && err != filepath.SkipDir { // Notice we pass the original `path` here + if err := symwalk(path, info, walkFn); err != nil && err != filepath.SkipDir { return err } return nil diff --git a/pkg/ignore/rules.go b/pkg/ignore/rules.go index 3f20a1b16..88de407ad 100644 --- a/pkg/ignore/rules.go +++ b/pkg/ignore/rules.go @@ -88,7 +88,6 @@ func Parse(file io.Reader) (*Rules, error) { // // Ignore evaluates path against the rules in order. Evaluation stops when a match // is found. Matching a negative rule will stop evaluation. -// Ignore evaluates the file at the given path, and returns true if it should be ignored. func (r *Rules) Ignore(path string, fi os.FileInfo) bool { // Don't match on empty dirs. if path == "" { @@ -129,7 +128,6 @@ func (r *Rules) Ignore(path string, fi os.FileInfo) bool { } } return false - } // parseRule parses a rule string and creates a pattern, which is then stored in the Rules object.