summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-23 17:05:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-23 21:59:17 +0100
commit3134ae11270dae9d8dddc5a16e2321b675b5d522 (patch)
tree224b59e8915fc9b3672bf82c654610d6fec40cfa
parent7c11b327a1cf116ccfd3df05e84845dbcb3d3fd8 (diff)
downloadast2050-yocto-poky-3134ae11270dae9d8dddc5a16e2321b675b5d522.zip
ast2050-yocto-poky-3134ae11270dae9d8dddc5a16e2321b675b5d522.tar.gz
sanity: Check for setgid/setuid TMPDIR
Building in a TMPDIR which has setgid or setuid is a bad idea. We could try and reset the permissions but since these can also invade into other directories like the cache or sstate, lets tell the user to fix it instead. [YOCTO #6519] (From OE-Core rev: 8e44fc36018fda9b1f9ca8aebde3e744afc07eaa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sanity.bbclass6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index ed65814..1ad663a 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -514,6 +514,7 @@ def check_sanity_version_change(status, d):
import xml.parsers.expat
except ImportError:
status.addresult('Your python is not a full install. Please install the module xml.parsers.expat (python-xml on openSUSE and SUSE Linux).\n')
+ import stat
status.addresult(check_make_version(d))
status.addresult(check_tar_version(d))
@@ -566,6 +567,11 @@ def check_sanity_version_change(status, d):
# Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS)
tmpdir = d.getVar('TMPDIR', True)
status.addresult(check_create_long_filename(tmpdir, "TMPDIR"))
+ tmpdirmode = os.stat(tmpdir).st_mode
+ if (tmpdirmode & stat.S_ISGID):
+ status.addresult("TMPDIR is setgid, please don't build in a setgid directory")
+ if (tmpdirmode & stat.S_ISUID):
+ status.addresult("TMPDIR is setuid, please don't build in a setuid directory")
# Some third-party software apparently relies on chmod etc. being suid root (!!)
import stat
OpenPOWER on IntegriCloud