Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A67C4EB64DC for ; Mon, 3 Jul 2023 11:17:01 +0000 (UTC) Subject: Regarding overiding of file permissions using fs-perms.txt in distro layer. #bitbake To: openembedded-core@lists.openembedded.org From: "yogish sanjeeva" X-Originating-Location: Bengaluru, Karnataka, IN (103.5.134.169) X-Originating-Platform: Windows Chrome 114 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Mon, 03 Jul 2023 04:17:00 -0700 Message-ID: Content-Type: multipart/alternative; boundary="E7Ll9zr95HMWxaXKbLdd" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 03 Jul 2023 11:17:01 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/183800 --E7Ll9zr95HMWxaXKbLdd Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Dear Team, We have modified base-passwd recipe and we have added couple of new UID/GID= for eg., shell. Our fs-perms.txt is similar to https://github.com/openembedded/openembedded= -core/blob/master/meta/files/fs-perms.txt, with extra entries as below ${base_bindir}=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00751 =C2=A0 =C2=A0root =C2= =A0 =C2=A0shell =C2=A0 true =C2=A0 =C2=A00655 =C2=A0 =C2=A0root =C2=A0 =C2= =A0shell ${base_sbindir}=C2=A0 =C2=A0 =C2=A0 =C2=A00751 =C2=A0 =C2=A0root =C2=A0 =C2= =A0shell =C2=A0 true =C2=A0 =C2=A00655 =C2=A0 =C2=A0root =C2=A0 =C2=A0shell ${base_libdir} =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00751 =C2=A0 =C2=A0root =C2= =A0 =C2=A0system =C2=A0true =C2=A0 =C2=A00644 =C2=A0 =C2=A0root =C2=A0 =C2= =A0system ${prefix}=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 075= 1 =C2=A0 =C2=A0root =C2=A0 =C2=A0system =C2=A0true =C2=A0 =C2=A00644 =C2=A0= =C2=A0root =C2=A0 =C2=A0system ${bindir}=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 075= 1 =C2=A0 =C2=A0root =C2=A0 =C2=A0system =C2=A0true =C2=A0 =C2=A00655 =C2=A0= =C2=A0root =C2=A0 =C2=A0system We had tried overlaying fs-perms.txt using FILESYSTEM_PERMS_TABLES(meta/ fi= les/fs-perms.txt) macro,But we have encountered below error as it was not r= eferring the target file /etc/passwd. File: '/oe-core/meta/classes/ package.bbclass', lineno: 953, function: _pro= cgid 0949: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return -1 0950: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0elif gid.isdigit(): 0951: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return int(gid= ) 0952: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else: *** 0953: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return grp= .getgrnam(gid).gr_gid0954: 0955: # Use for debugging the entries0956: def str(self):0957: if self.link:Exception: *KeyError: "getgrnam(): name not found: 'shell'"* *Question: * Why packagegroup recipes are not able to find the *shell* user, even thou= gh we added base-passwd as depends in those modules? --E7Ll9zr95HMWxaXKbLdd Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Dear Team,

We have mo= dified base-passwd recipe and we have added couple of new UID/GID for eg., = shell.
Our fs-perms.txt is similar to  <= a href=3D"https://github.com/openembedded/openembedded-core/blob/master/met= a/files/fs-perms.txt," target=3D"_blank" rel=3D"noopener">https://github.co= m/openembedded/openembedded-core/blob/master/meta/files/fs-perms.txt,&n= bsp;with extra entries as below

${base_= bindir}         0751    root   &nbs= p;shell   true    0655    root    shell<= /span>
${base_sbindir}    &nbs= p;  0751    root    shell   true    = ;0655    root    shell
${base_libdir}          0751   &nbs= p;root    system  true    0644    root &= nbsp;  system
${prefix} = ;                 0751    = ;root    system  true    0644    root &n= bsp;  system
${bindir} =                 0751    = root    system  true    0655    root &nb= sp;  system

  &nb= sp;We had tried overlaying fs-perms.txt using FILESYSTEM_PERMS_TABLES(meta/=
files/fs-perms.txt) macro,But w= e have encountered below error as it was not referring the target file /etc= /passwd.

File: = '/oe-core/meta/classes/package.= bbclass', lineno: 953, function: _procgid

 0949:         &nbs= p;      return -1
 0950:            elif gid.isdi= git():
 0951:  = ;              return int(gid)
 0952:       =      else:
0955:  
# Use for debugging the entries0956:    = ;  
                 = ;    def str(self):0957:        
  =                   if self.link= :Exception:
KeyError: "getgrnam(): name not found: 'shell'"

Question:

Why packagegroup recipes are not = able to find the shell user, even though we added base-pas= swd as depends in those modules?

--E7Ll9zr95HMWxaXKbLdd--