Skip to content

Tar expects paths to be relative to the working dir #3481

@trulede

Description

@trulede

resolvedArgs[i] = t.ResolvePath(arg)

When used from Task, this code is producing absolute paths (i.e. filepath.Join(b.WorkingDir, path)), however the expectation is that these paths remain relative, otherwise the tar command fails. It seems like b.WorkingDir is set and that results in a relative path becoming an absolute path, which tar rejects.

The exact resolution is unclear, but perhaps calling ResolvePath() is wrong, and instead a check should ensure that path is relative to b.WorkingDir - I think that is the original intention, however ResolvePath() is used in different ways in the code which suggests that the comment and code are not matching (any more).

Related go-task/task#2567

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions