[oe-commits] [openembedded-core] 18/54: package.bbclass: fix directories setuid and setgid bits

git at git.openembedded.org git at git.openembedded.org
Mon Sep 30 15:45:21 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch warrior
in repository openembedded-core.

commit fe6546aab208e5fa2e238aa266db0ea66ad520a1
Author: Joël Esponde <joel.esponde at easymile.com>
AuthorDate: Thu Jul 18 15:47:39 2019 +0200

    package.bbclass: fix directories setuid and setgid bits
    
    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>
    Signed-off-by: Armin Kuster <akuster808 at gmail.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 2c44fc1..472d542 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1210,7 +1210,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)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list