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] copa overwrites /usr/sbin symlink for mariner distroless/debug #850

Open
1 task
sozercan opened this issue Nov 26, 2024 · 1 comment
Open
1 task
Labels
bug Something isn't working

Comments

@sozercan
Copy link
Member

sozercan commented Nov 26, 2024

Version of copa

v0.9.0

Expected Behavior

copa should not change the existing directory structure and symlinks

Actual Behavior

copa overwrites the existing symlink

Steps To Reproduce

  1. Check config for original image https://oci.dag.dev/layers/mcr.microsoft.com/cbl-mariner/distroless/debug@sha256:960d95cc274484fc72b33d4b5720857fbb1c9a5f35b93a39f8e161557236fd4d/
    70a0cf87 lrwxrwxrwx 0/0 0 2024-01-23 18:52 sbin -> usr/sbin

  2. copa patch -i mcr.microsoft.com/cbl-mariner/distroless/debug:2.0.20241029

  3. Check config for patched image: https://oci.dag.dev/layers/sertacacr.azurecr.io/debug:2.0-patched@sha256:ffb2188eb72313a86dc3b0a00e903c2cbd0eda565a50bbc47038ec04b8b0b174/
    d0a2b129 drwxr-xr-x 0/0 0 2024-11-26 19:04 sbin

Mariner 2 spec provides /sbin as the path and copa is extracting to that path since that's the path in the rpm. Copa should check if existing path is a symlink and follow the path instead of dropping the files
https://github.com/microsoft/azurelinux/blob/2.0/SPECS/busybox/busybox.spec#L94

Are you willing to submit PRs to contribute to this bug fix?

  • Yes, I am willing to implement it.
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: 🆕 New
Development

No branches or pull requests

2 participants