Skip to contentSkip to conversation

Fixing [host-user-contaminated] warning

DISCUSSION [email protected] 4 participants 4 messages Oct 16, 2022

lore
Share & tools
lore
#0 lore raw

Hi,
I am working on a project that uses some proprietary layers from a 3rd party. These layers provide tar archives that include prebuilt binaries of some packages and these archives cause host-user-contaminated warnings. Since I only have the root user in my target system, and since I changed the UID/GID of my build user I assume it is not a false-positive. So, I dug a bit to find and resolve the issue and find the function that installs binaries. The function only extracts a tar archive to the ${D} directory with the command below, nothing else. No fakeroot, no management of ownership/permissions.

Quoted 2 lines

tar -xjvf $prebuiltdir/${TARGET}/${PN}/${PN}-binaries.tar -C ${D}

I tried various options of tar to extract these files with different UID and GID with no success.
How can I solve this issue? I think it would be better if I patch the script to use the install command but I am not sure how can I integrate that kind of workflow with lots of tar archives that includes lots of subdirectories.

P.S. : I use an LXC-based non-privileged ubuntu container in Proxmox VE as the build host. I don't know if it may affect something but wanted to mention it just in case.

Best regards,
Umut Ediz

#1 lore raw

On Sun, Oct 16, 2022 at 12:13 PM <[email protected]> wrote:

%< SNIP %<

Quoted 7 lines

I tried various options of tar to extract these files with different UID and GID with no success.
How can I solve this issue? I think it would be better if I patch the script to use the install command but I am not sure how can I integrate that kind of workflow with lots of tar archives that includes lots of subdirectories.

You were unclear about which tar options you tried, so it makes me wonder if you tried --no-same-owner. I use that in a number of places in my builds and it works just fine.

..Ch:W..

Signature · 2 lines
*"Perfection must be reached by degrees; she requires the slow hand of
time." - Voltaire*
#2 lore raw
In reply to [email protected]

You can also chown the files after unpacking them (like in
https://github.com/webOS-ports/meta-webos-ports/commit/9fd17a67cdbed92df13a14b002a189b4c6c2d442
)

Quoted 37 lines · On Sun, Oct 16, 2022 at 9:13 PM <[email protected]> wrote:

Hi,
I am working on a project that uses some proprietary layers from a 3rd party. These layers provide tar archives that include prebuilt binaries of some packages and these archives cause host-user-contaminated warnings. Since I only have the root user in my target system, and since I changed the UID/GID of my build user I assume it is not a false-positive. So, I dug a bit to find and resolve the issue and find the function that installs binaries. The function only extracts a tar archive to the ${D} directory with the command below, nothing else. No fakeroot, no management of ownership/permissions.

tar -xjvf $prebuiltdir/${TARGET}/${PN}/${PN}-binaries.tar -C ${D}

I tried various options of tar to extract these files with different UID and GID with no success.
How can I solve this issue? I think it would be better if I patch the script to use the install command but I am not sure how can I integrate that kind of workflow with lots of tar archives that includes lots of subdirectories.

P.S. : I use an LXC-based non-privileged ubuntu container in Proxmox VE as the build host. I don't know if it may affect something but wanted to mention it just in case.

Best regards,
Umut Ediz
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#58342):
https://lists.yoctoproject.org/g/yocto/message/58342
Mute This Topic: https://lists.yoctoproject.org/mt/94369702/3617156
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw

I also tried chown but I am getting permission errors. But I thought this should not be the case since these commands are running under fake root… But I found out this is not the case since these operations running in a custom task rather than do_install so fakeroot usage should be explicit, afaik. I tried to add fakeroot prefix to the related function and updated the task dependency but still I get permission errors.

Quoted 23 lines · Martin Jansa

You can also chown the files after unpacking them (like in https://github.com/webOS-ports/meta-webos-ports/commit/9fd17a67cdbed92df13a14b002a189b4c6c2d442 <https://github.com/webOS-ports/meta-webos-ports/commit/9fd17a67cdbed92df13a14b002a189b4c6c2d442>)

On Sun, Oct 16, 2022 at 9:13 PM <[email protected] <mailto:[email protected]>> wrote:
Hi,
I am working on a project that uses some proprietary layers from a 3rd party. These layers provide tar archives that include prebuilt binaries of some packages and these archives cause host-user-contaminated warnings. Since I only have the root user in my target system, and since I changed the UID/GID of my build user I assume it is not a false-positive. So, I dug a bit to find and resolve the issue and find the function that installs binaries. The function only extracts a tar archive to the ${D} directory with the command below, nothing else. No fakeroot, no management of ownership/permissions. tar -xjvf $prebuiltdir/${TARGET}/${PN}/${PN}-binaries.tar -C ${D}
I tried various options of tar to extract these files with different UID and GID with no success.
How can I solve this issue? I think it would be better if I patch the script to use the install command but I am not sure how can I integrate that kind of workflow with lots of tar archives that includes lots of subdirectories.

P.S. : I use an LXC-based non-privileged ubuntu container in Proxmox VE as the build host. I don't know if it may affect something but wanted to mention it just in case.

Best regards,
Umut Ediz
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#58342): https://lists.yoctoproject.org/g/yocto/message/58342 <https://lists.yoctoproject.org/g/yocto/message/58342>
Mute This Topic: https://lists.yoctoproject.org/mt/94369702/3617156 <https://lists.yoctoproject.org/mt/94369702/3617156>
Group Owner: [email protected] <mailto:yocto%[email protected]>
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub <https://lists.yoctoproject.org/g/yocto/unsub> [[email protected] <mailto:[email protected]>]
-=-=-=-=-=-=-=-=-=-=-=-