diff options
| author | Tim Orling <tim.orling@konsulko.com> | 2026-05-02 14:01:40 -0700 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2026-05-11 20:11:22 +0000 |
| commit | f7eb4abba27a54c06432cca45f817f21f5754532 (patch) | |
| tree | 7377ef0f04e9536a944d64c17569ef0a84ccb8e0 /recipes-devtools/python/python-m2crypto | |
| parent | 7ab697991c867dfd9da5704e3ca71f633faf476b (diff) | |
| download | meta-virtualization-f7eb4abba27a54c06432cca45f817f21f5754532.tar.gz | |
image-oci: don't preserve ownership in directories/files/host layer copies
The multi-layer 'directories', 'files', and 'host' branches in IMAGE_CMD:oci
copy delta content into the OCI bundle rootfs with 'cp -a'. 'cp -a' implies
'--preserve=all', which calls lchown() on the destination to copy ownership
from the source. When a directories/files layer copies a symbolic link whose
target does not exist at build time (for example, the '/dev/stdout' and
'/dev/stderr' log forwarding symlinks used by the official nginx Docker
image), lchown() can return EINVAL under pseudo and 'cp' aborts with:
cp: failed to preserve ownership for .../var/log/nginx/access.log: Invalid argument
failing the whole do_image_oci task.
The single-layer rootfs copy already handles this correctly:
cp -r -a --no-preserve=ownership ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs
and the multi-layer 'packages' branch uses 'rsync -a --no-owner --no-group'
for the same reason. Bring the three remaining cp -a sites in line by adding
'--no-preserve=ownership'. Ownership inside an OCI image is set by umoci
based on the image config and source ownership has no meaning for symlinks
to runtime device nodes anyway, so dropping preservation is the correct
behaviour.
Reproduce: declare a directories: layer that copies a path containing a
symlink to '/dev/stdout' or '/dev/stderr' (e.g. a postprocess that creates
/var/log/nginx/{access,error}.log -> /dev/{stdout,stderr} to mirror the
upstream nginx Docker image).
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-devtools/python/python-m2crypto')
0 files changed, 0 insertions, 0 deletions
