[oe] [PATCH] package.bbclass: fix directories setuid and setgid bits
Jean-Tiare Le Bigot
jean-tiare.le-bigot at easymile.com
Thu Jun 27 09:11:16 UTC 2019
Oh, sorry. Resending.
On Thu, 27 Jun 2019 at 11:06, Burton, Ross <ross.burton at intel.com> wrote:
> This should go to openembedded-core at lists.openembedded.org, not -devel.
>
> Ross
>
> On Thu, 27 Jun 2019 at 09:59, Jean-Tiare Le Bigot
> <jean-tiare.le-bigot at easymile.com> wrote:
> >
> > From: Joël Esponde <joel.esponde at easymile.com>
> >
> > populate_packages relies on ``mkdir`` to both create a directory and set
> > its permissions. However, ``mkdir`` honors the ``umask`` value.
> > Therefore, some bits may be lost in the operation. In our case, the
> > setgid bit on the directories were lost.
> >
> > This commit fixes this by having a distinct call to create the directory
> > and to set the permissions.
> >
> > Signed-off-by: Jean-Tiare Le Bigot <jean-tiare.le-bigot at easymile.com>
> > ---
> > meta/classes/package.bbclass | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> > index 20d72bba79..cd223a121e 100644
> > --- a/meta/classes/package.bbclass
> > +++ b/meta/classes/package.bbclass
> > @@ -1216,7 +1216,8 @@ python populate_packages () {
> > src = os.path.join(src, p)
> > dest = os.path.join(dest, p)
> > fstat = cpath.stat(src)
> > - os.mkdir(dest, fstat.st_mode)
> > + os.mkdir(dest)
> > + os.chmod(dest, fstat.st_mode)
> > os.chown(dest, fstat.st_uid, fstat.st_gid)
> > if p not in seen:
> > seen.append(p)
> > --
> > 2.19.1
> >
> > --
> > _______________________________________________
> > Openembedded-devel mailing list
> > Openembedded-devel at lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>
--
Jean-Tiare Le Bigot
More information about the Openembedded-devel
mailing list