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

Clean up workspace dir from inside runner to avoid permission errors. #1648

Merged
merged 1 commit into from
Nov 15, 2024

Commits on Nov 14, 2024

  1. Clean up workspace dir from inside runner to avoid permission errors.

    When running privileged docker as an unprivileged user, the files that
    are created in the WorkspaceDir are created as root. Even if the build
    were run as non-root, they would not necessarily be the same ownership
    as the user invoking melange.
    
    As a result, WorkspaceDir would not be able to be cleaned up and
    melange would just leave files there to later be cleaned up with
    a dangerous 'sudo rm -Rf' by the user.
    
    The change here is to clean up the WorkspaceDir from _inside_ the
    container, where the uid is the same as the uid that created the files.
    
    I believe this will waste IO and/or time on the qemu runner,
    where /home/build isn't actually bind'd in.  Later we could expose a
    CleanWorkspace from the runner that was a noop in qemu.
    
    Signed-off-by: Scott Moser <[email protected]>
    smoser committed Nov 14, 2024
    Configuration menu
    Copy the full SHA
    beaef88 View commit details
    Browse the repository at this point in the history