Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

path: dest paths inside container should always be treated as *nix type #731

Merged

Conversation

flouthoc
Copy link
Collaborator

Closes: containers/podman#10900

Destination path inside containers should be always validated as
*nixtype absolute path.

So its recommended to use path.IsAbs() instead of filtepath.IsAbs() for destination checks. Since filepath.IsAbs() will use path_windows on windows host but destination path inside the containers should always be of *nix type.

Reference:
https://cs.opensource.google/go/go/+/refs/tags/go1.16.7:src/path/path.go;l=219
https://cs.opensource.google/go/go/+/refs/tags/go1.16.7:src/path/filepath/path_windows.go
https://cs.opensource.google/go/go/+/refs/tags/go1.16.7:src/path/filepath/path_unix.go

Destination path inside containers should be always validated  as
*nix absolute path. So its recommended to use path.IsAbs() instead of
filepath.IsAbs().

[NO TEST NEEDED]

Signed-off-by: flouthoc <[email protected]>
@flouthoc
Copy link
Collaborator Author

@rhatdan PTAL

@flouthoc
Copy link
Collaborator Author

flouthoc commented Aug 16, 2021

Not needed anymore after containers/podman#11231 but still good to use path instead of filepath.

@rhatdan
Copy link
Member

rhatdan commented Aug 16, 2021

/approve
LGTM
@containers/podman-maintainers PTAL

@rhatdan
Copy link
Member

rhatdan commented Aug 16, 2021

@saschagrunert @vrothberg @giuseppe PTAL

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 16, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: flouthoc, giuseppe, rhatdan, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@giuseppe
Copy link
Member

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Podman remote windows cannot mount volume: invalid container path "/data", must be an absolute path
4 participants