<?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>7428</bug_id>
          
          <creation_ts>2015-03-09 12:45:27 +0000</creation_ts>
          <short_desc>meta/lib/oe/package.py: wrong file ownership in packages</short_desc>
          <delta_ts>2015-05-18 16:22:50 +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>core</component>
          <version>1.7.2</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.7.3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>fabrice.coulon</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>49288</commentid>
    <comment_count>0</comment_count>
    <who name="">fabrice.coulon</who>
    <bug_when>2015-03-09 12:45:27 +0000</bug_when>
    <thetext>The commit with SHA1 6f7943 currently in Poky branch &quot;origin/dizzy&quot; , has created some problems for us. We have seen that the ownership of some files in rpm packages have changed from UID:GID e.g root:viewer to root:root. The do_install task was producing correct/expected output but when the files are being put in a rpm package, they changed ownership.

I have run git bisect and managed to isolate the commit that was triggering the problem (commit with SHA1 6f7943 for meta/lib/oe/package.py):

-    stripcmd = &quot;&apos;%s&apos; %s &apos;%s&apos;&quot; % (strip, extraflags, file)
+    # Use mv to break hardlinks
+    stripcmd = &quot;&apos;%s&apos; %s &apos;%s&apos; -o &apos;%s.tmp&apos; &amp;&amp; mv &apos;%s.tmp&apos; &apos;%s&apos;&quot; % (strip, extraflags, file, file, file, file)


If I change that line to this instead:


stripcmd = &quot;&apos;%s&apos; %s &apos;%s&apos; -o &apos;%s.tmp&apos; &amp;&amp; chown --reference=&apos;%s&apos; &apos;%s.tmp&apos; &amp;&amp; mv &apos;%s.tmp&apos; &apos;%s&apos;&quot; % (strip, extraflags, file, file, file, file, file, file)


Then, the ownership is kept as expected. I have also checked that the problem is also on master. If you confirm that this can be an issue, I can send a patch today with the suggested solution.

/Fabrice</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49387</commentid>
    <comment_count>1</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2015-03-12 00:36:27 +0000</bug_when>
    <thetext>Please go ahead and send the patch if you have not already, for inclusion in Dizzy also.  Should to go master and dizzy probably.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49787</commentid>
    <comment_count>2</comment_count>
    <who name="">fabrice.coulon</who>
    <bug_when>2015-03-26 09:13:54 +0000</bug_when>
    <thetext>I&apos;ve seen the fix has been pushed to master branch but could you also make it available on the Dizzy branch of Poky?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51001</commentid>
    <comment_count>3</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-05-14 15:02:51 +0000</bug_when>
    <thetext>For reference the fix merged to master was this one:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=1e34e71e0f6752ec33eb4b30ce72f249b80e9a5d

Since this got stalled I&apos;ll do the backport and send it for dizzy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51050</commentid>
    <comment_count>4</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-05-15 15:34:53 +0000</bug_when>
    <thetext>dizzy patch posted for review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51087</commentid>
    <comment_count>5</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-05-18 16:22:50 +0000</bug_when>
    <thetext>Fix has now been merged into the dizzy branch also:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=dizzy&amp;id=6adbd2deb92a4159106b78fe880d97ac7e686e95

Marking as resolved.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>