<?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>14385</bug_id>
          
          <creation_ts>2021-05-07 11:46:10 +0000</creation_ts>
          <short_desc>mode of sstate files created under pseudo</short_desc>
          <delta_ts>2024-03-12 13:54:30 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Pseudo</product>
          <component>poky integration</component>
          <version>unspecified</version>
          <rep_platform>x86</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>5.0 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Frans Meulenbroeks">fransmeulenbroeks</reporter>
          <assigned_to name="Eilís Ní Fhlannagáin">pidge</assigned_to>
          <cc>ernstp</cc>
    
    <cc>mhalstead</cc>
    
    <cc>pidge</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
    
    <cc>yp.pseudo.watcher</cc>
    
    <cc>yp.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>90317</commentid>
    <comment_count>0</comment_count>
    <who name="Frans Meulenbroeks">fransmeulenbroeks</who>
    <bug_when>2021-05-07 11:46:10 +0000</bug_when>
    <thetext>I am using bitbake to build a yocto image with sstate.
Files created in sstate-cache are created when running under pseudo. sstate.bbclass creates these files with mode 775 (dirs) or 664 (files) so they are group readable/writable.
After creation of the files I see that the files have the right mode and are owned by root.
However when I look at the files as they are on disk after running bitbake they are owned by the user starting bitbake, and have modes 755 and 644.

My expectation was that the UID of the files would indeed be the user that starts bitbake but that the mode would be the same as the mode when the file was written.

I could not find any info on this in the docs (but maybe I overlooked) but the behavior is not as I expected.

Maybe this is intended, if so it should probably be documented (and maybe there should be an option --retain-file-modes or something like that to make that the mode is not changed). If not intended a fix would be nice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90362</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-05-13 14:40:26 +0000</bug_when>
    <thetext>The use case as discussed on IRC is two people to be able to share the same sstate cache. The assumption is that different parts of the code are not using the same properties.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91093</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2021-08-03 18:42:03 +0000</bug_when>
    <thetext>I just saw this one.  What are the umask of the user creating the files?

It&apos;s not unusual for a umask of 755 to exist.

What will end up happening is pseudo will know it&apos;s not allowed to create the files as 775/664.  But because you are running within pseudo context (in order to copy in the files from the work dir) the system will create the files and try for 775/664, but fall back to the umask if necessary.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91114</commentid>
    <comment_count>3</comment_count>
    <who name="Frans Meulenbroeks">fransmeulenbroeks</who>
    <bug_when>2021-08-05 06:43:42 +0000</bug_when>
    <thetext>Initially I also suspected umask so I changed the umask to 0000.
However that did not resolve the issue. 

After doing that some of the dirs end up with mode 755 others with 775.
E.g. from a recent build I get:

4 drwxr-xr-x 2 frans   docker  4096 Aug  5 05:53 ./90/3d
4 drwxrwxr-x 2 frans   docker  4096 Aug  5 05:49 ./91/65

No idea why one dir is 755 and the other is 755.

(Actually all our builds run in a docker container that has umask 0000, I have outruled that this is actually a docker issue; if I create a dir under docker then outside the docker the dir has mode 777)

As mentioned in the original comment this seems related to pseudo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95708</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-06-13 16:01:53 +0000</bug_when>
    <thetext>I just trawled through my huge sstate and I think I can see files with mysteriously missing group writable bits that were created in the last year.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95724</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-06-15 14:16:48 +0000</bug_when>
    <thetext>(In reply to Ross Burton from comment #4)
&gt; I just trawled through my huge sstate and I think I can see files with
&gt; mysteriously missing group writable bits that were created in the last year.

Any pattern to them?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95747</commentid>
    <comment_count>6</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-06-19 18:43:51 +0000</bug_when>
    <thetext>I _think_ this is resolved in mickledore onwards.  At least I just did a fresh huge build and none of the permissions were unexpected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96344</commentid>
    <comment_count>7</comment_count>
    <who name="Eilís Ní Fhlannagáin">pidge</who>
    <bug_when>2023-09-05 13:26:20 +0000</bug_when>
    <thetext>I&apos;ve been looking for this on current master and haven&apos;t seen this yet, so I think this is in fact fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96667</commentid>
    <comment_count>8</comment_count>
    <who name="Eilís Ní Fhlannagáin">pidge</who>
    <bug_when>2023-10-10 10:39:00 +0000</bug_when>
    <thetext>I&apos;m marking this worksforme as I&apos;ve yet to see this issue and concur with Ross that this has been fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97188</commentid>
    <comment_count>9</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-11-02 15:18:46 +0000</bug_when>
    <thetext>We think there&apos;s still a bug as reported on IRC.
It may be an issue related to different umask, sstate-tasks and pseudo.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97250</commentid>
    <comment_count>10</comment_count>
    <who name="Eilís Ní Fhlannagáin">pidge</who>
    <bug_when>2023-11-14 10:28:31 +0000</bug_when>
    <thetext>I&apos;ve tried again to replicate this, using different users with different umasks, still with no luck. I&apos;m going to try again with a clean sstate (starting with umask of 0022 and then moving to 0002) later this week, to see if I can replicate this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97438</commentid>
    <comment_count>11</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-12-07 14:44:37 +0000</bug_when>
    <thetext>egueli in http://irc.yoctoproject.org/irc/%23yocto.2023-10-30.log.html reported this as happening with mickledore. I&apos;m not aware of fixes since then.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97582</commentid>
    <comment_count>12</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2023-12-15 13:59:02 +0000</bug_when>
    <thetext>https://git.yoctoproject.org/poky/commit/?id=47cc6288280bd38f42851d6423a5ffc95a46eea4 should help

Still pending testcase?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97590</commentid>
    <comment_count>13</comment_count>
    <who name="Frans Meulenbroeks">fransmeulenbroeks</who>
    <bug_when>2023-12-16 11:38:07 +0000</bug_when>
    <thetext>@RP this looks like a good solution.
At the moment I (as bug reporter) have no possibility to verify this, but it should be pretty straightforward to create a test case for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97906</commentid>
    <comment_count>14</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-01-18 16:24:57 +0000</bug_when>
    <thetext>Still missing a test case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98461</commentid>
    <comment_count>15</comment_count>
    <who name="Eilís Ní Fhlannagáin">pidge</who>
    <bug_when>2024-03-12 13:54:30 +0000</bug_when>
    <thetext>Fixed at https://git.yoctoproject.org/poky/commit/?id=47cc6288280bd38f42851d6423a5ffc95a46eea4
Test at https://git.yoctoproject.org/poky/commit/?id=2b5903f51105715addbde13ac9811ae4eb142f10</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>