Skip to content

loadPatterns opens in-root .gitignore files with os.Open, outside fsroot #1205

Open

Description

@David-Noble-at-work

Area

Product

What happens

pkg/gitignore/tracker.go:203's loadPatterns uses os.Open on an absolute path, and it is called for in-root .gitignore files too, not only the global one. That read is inside the root and escapes fsroot, the same class as the os.Chown escape fixed in #687 (#694, read on develop when filed).

What should happen

In-root .gitignore files are read through an fsroot.Dir, however #694's configuration question is settled. It is smaller than the rest of #694 and independent of it, and worth doing first.

Evidence of completion

Before this issue closes, a comment on it links the pull request and the test that reads an in-root .gitignore through fsroot.

Plan and design documents

Kind Document
Plan Not yet opened
Related #694, the feature; #677, the claims that surfaced it; #530, hermeticity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions