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

poudriere-image generate wrong / owner with overlaydir option #1181

Open
4 tasks done
ocochard opened this issue Oct 21, 2024 · 1 comment
Open
4 tasks done

poudriere-image generate wrong / owner with overlaydir option #1181

ocochard opened this issue Oct 21, 2024 · 1 comment
Labels

Comments

@ocochard
Copy link
Member

ocochard commented Oct 21, 2024

Prerequisites

  • Have you checked for an existing issue describing your problem?
  • Are you running the latest version?
  • Is your ports tree recent?
  • Is your FreeBSD Host on a supported release?

Describe the bug

Generating a poudriere-image with option `-c overlaydir`, when this directory belongs to a local system user, broke permission on the generated filesystem.

How to reproduce

Steps to reproduce the behavior:

with a local simple user:

mkdir -p /tmp/overlay/root
mkdir -p /tmp/overlay/etc
touch /tmp/overlay/etc/dummy1.txt
touch /tmp/overlay/root/dummy2.txt
sudo poudriere image ... -c /tmp/overlay

The generated image will have all existing directories belonging to an unknown user (because host local user id doesn’t exist on generated image), in this example its /, /etc and /root.
These bug is due to the cp -fRpr used.

Expected behavior

We could not preserve original user owner when copying the overlay directory: There is no local user created by default on the targeted disk image, and an already existing directory should not have this owner overwrited.

@ocochard ocochard added the bug label Oct 21, 2024
@ocochard
Copy link
Member Author

ocochard commented Oct 22, 2024

A potential replacement of the cp could be something like (cd "${EXTRADIR}" && find . -print0 | cpio -pdm0 --no-preserve-owner ${WRKDIR}/world/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant