summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoël Esponde <joel.esponde@easymile.com>2019-07-18 15:47:39 +0200
committerArmin Kuster <akuster808@gmail.com>2019-08-10 07:28:29 -0700
commitc05342e30581a6280aabac621c31174eafa1ffd3 (patch)
tree76ec3b29e41f6d7ed82f62740ee0380aa1d754f5
parentd000f85c4dfa791e2e764c9d6126bcc13baea01c (diff)
downloadopenembedded-core-contrib-c05342e30581a6280aabac621c31174eafa1ffd3.tar.gz
openembedded-core-contrib-c05342e30581a6280aabac621c31174eafa1ffd3.tar.bz2
openembedded-core-contrib-c05342e30581a6280aabac621c31174eafa1ffd3.zip
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@easymile.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta/classes/package.bbclass3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 2c44fc1f0d..472d542b11 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)