<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13836</bug_id>
          
          <creation_ts>2020-03-18 09:17:53 +0000</creation_ts>
          <short_desc>do_package_qa wrongly warns about a host user contamination</short_desc>
          <delta_ts>2020-06-18 08:01:26 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>deployment</component>
          <version>3.0.2</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>h4nn35.work</reporter>
          <assigned_to name="Trevor Gamblin">tvgamblin</assigned_to>
          <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>86744</commentid>
    <comment_count>0</comment_count>
    <who name="">h4nn35.work</who>
    <bug_when>2020-03-18 09:17:53 +0000</bug_when>
    <thetext>Preconditions/Environment
-------------------------
I think the setup isn&apos;t important in this case, but I&apos;m building on Debian 9/ Ubuntu 19.04 for ARM (Cortex A8/A9) and x86-64 targets.

Triggering Action/Cause
-----------------------
Install into a home directory of a user(not system user) a file with the USER as owner.

Expectation
-----------
No warning should be trigger.

Actual Result
-------------
do_package_qa: QA Issue: package: /home/user/user.xml is owned by uid 1000, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]

Reproducibility
---------------
20/20


I think the check in the insane.bbclass is not correct:

dest = d.getVar(&apos;PKGDEST&apos;)
    pn = d.getVar(&apos;PN&apos;)
    home = os.path.join(dest, &apos;home&apos;)
    if path == home or path.startswith(home + os.sep):
        return

Because the path, as far as I checked, will never start with &apos;home/&apos; and the other comparison will only be valid for the home directory on the target but not for anything inside of home.
But the comment and the reference manual states: 
&quot;host-user-contaminated: Checks that no package produced by the recipe contains any files outside of /home with a user or group ID that matches the user running BitBake.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87148</commentid>
    <comment_count>1</comment_count>
    <who name="Trevor Gamblin">tvgamblin</who>
    <bug_when>2020-05-06 06:34:19 +0000</bug_when>
    <thetext>Hi,

Can you provide more info on the steps you took? It&apos;s not clear to me what your objective is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87173</commentid>
    <comment_count>2</comment_count>
    <who name="">h4nn35.work</who>
    <bug_when>2020-05-07 10:14:04 +0000</bug_when>
    <thetext>My objective is to install a file into a user directory like /home/user/user.xml which has user ownership.
It is similar to what is done in https://git.yoctoproject.org/cgit.cgi/poky/tree/meta-skeleton/recipes-skeleton/useradd/useradd-example.bb
The difference is that I don&apos;t set the user id and so it starts at 1000 and most of the time this is same user id as used on the build system.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87512</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2020-06-18 08:01:26 +0000</bug_when>
    <thetext>In this case you *want* a non-root UID, so the solution would be to skip this QA test:

INSANE_SKIP_${PN} += &quot;host-user-contaminated&quot;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>