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

[RFC] overlay: make sure directories omitted from layers have the right permissions #1653

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Jul 6, 2023

  1. aufs,overlay: backfill intermediate directories when possible

    When extracting layer contents, if we find ourselves needing to
    implicitly create a directory (due to its not being included in the
    layer diff), try to give it the permissions, ownership, attributes, and
    datestamp of the corresponding directory from the layer which would be
    stacked below it.
    
    When a layer omits any of the directories which contain items which that
    layer adds or modifies, this should prevent the default values that we
    would use from overriding those which correspond to the same directory
    in a lower layer, which could later be mistaken as an indication that
    one or more of those was intentionally changed, forcing the directory to
    be pulled up.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    d91b39f View commit details
    Browse the repository at this point in the history
  2. chunked ApplyDiff(): track implicitly-created directories in layers

    When applying a chunked diff, ApplyDiff() iterates through the entries
    in the diff's table of contents, creating directories and other
    zero-length items like empty files, symbolic links, and directories,
    building a queue of hard links, and asking goroutines to locate files in
    other layers and configured OSTree repositories which contain content
    that matches what should eventually end up in non-zero-length files in
    the layer.
    
    If a file's entire contents couldn't be found locally, but it was split
    into chunks in the chunked diff, ApplyDiff() then searches for the
    chunks in local layers.
    
    Lastly, the contents of files with non-zero lengths, which ApplyDiff()
    had attempted to find locally, but which weren't found locally, are then
    requested from the registry.
    
    Track which directories in the layer are created implicitly by
    ApplyDiff(), so that the overlay driver can reset their ownership,
    permissions, extended attributes, and datestamps to match the
    immediately lower layer, if there is one.
    
    Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
    nalind committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    daa4ba0 View commit details
    Browse the repository at this point in the history