]> code.ossystems Code Review - openembedded-core.git/commitdiff
package.bbclass: fix directories setuid and setgid bits
authorJoël Esponde <joel.esponde@easymile.com>
Thu, 27 Jun 2019 09:12:04 +0000 (11:12 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 27 Jun 2019 23:02:44 +0000 (00:02 +0100)
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@easymile.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/package.bbclass

index 20d72bba799218985079fc9657f2cd29cefedd78..cd223a121e432e098fd922c1be5e7194db860415 100644 (file)
@@ -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)