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

clarify why copy.Copy is unsafe #159

Open
errordeveloper opened this issue Apr 25, 2023 · 1 comment
Open

clarify why copy.Copy is unsafe #159

errordeveloper opened this issue Apr 25, 2023 · 1 comment

Comments

@errordeveloper
Copy link

The documentation currently states this:

fsutil/copy/copy.go

Lines 65 to 66 in 9e7a6df

// Copy copies files using `cp -a` semantics.
// Copy is likely unsafe to be used in non-containerized environments.

It's not clear what is the safety concern exactly.

@tonistiigi
Copy link
Owner

I think this comment is old, before the proper rootPath protection were added. Before that, the concern was that copying paths that contain symlinks could potentially access files outside of the src/dest arguments.

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

No branches or pull requests

2 participants