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

Bug: symbolic links are not automatically overwritten when extracted from tar archive to File store #865

Open
Wwwsylvia opened this issue Jan 3, 2025 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@Wwwsylvia
Copy link
Member

Wwwsylvia commented Jan 3, 2025

Original issue in ORAS CLI repo: oras-project/oras#1593

Currently, when extracting a tar archive in File store, we do not handle the case where a symbolic link contained in the archive already exists in the file system. When such a case happens, a LinkError is thrown by the os.Symlink(target, path) function call on line 190.

case tar.TypeSymlink:
var target string
if target, err = ensureLinkPath(dir, prefix, path, header.Linkname); err == nil {
err = os.Symlink(target, path)
}

Since we automatically overwrite other files by default, we should keep it consistent for symbolic links as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant