storage icon indicating copy to clipboard operation
storage copied to clipboard

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

Open nalind opened this issue 2 years ago • 3 comments

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.

nalind avatar Jun 28 '23 20:06 nalind

@vrothberg @mtrmac @giuseppe @saschagrunert PTAL

rhatdan avatar Jul 07 '23 11:07 rhatdan

@nalind Waiting on you?

rhatdan avatar Aug 16 '23 12:08 rhatdan

which could later be mistaken as an indication that one or more of those was intentionally changed, forcing the directory to be pulled up.

Another way to solve this possibly: Add an xattr to the directory like user.containers.meta (with serialized extended state, json/bincode/whatever) that would include to start a boolean value like synthetic: true that denotes this state, and we know hence when re-serializing to ignore that directory

cgwalters avatar May 31 '24 19:05 cgwalters