summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-08-01 18:17:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-03 10:33:12 +0100
commit9aba9225d3677c6066fd5ec1c878fbca3c16d235 (patch)
treedb793c04a572f73bc833d8a4f26c2b754fd1db68 /meta/classes
parentc56e470d41928fb0a29d3320ec751ae6129181e0 (diff)
downloadast2050-yocto-poky-9aba9225d3677c6066fd5ec1c878fbca3c16d235.zip
ast2050-yocto-poky-9aba9225d3677c6066fd5ec1c878fbca3c16d235.tar.gz
classes/sanity: check for suid root command evility
Some users have been found to have an unnamed third-party piece of software installed which sets chmod, chown and mknod as suid root as part of its installation process. This interferes with the operation of pseudo and can result in files really being owned by root within the build output, and therefore breaks the build, apart from being a security issue. Check for this and bail out if it is found. Reported-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> (From OE-Core rev: 08d61529f3c7a48ec82e1f8c9c28c7b2e5238934) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/sanity.bbclass10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 08ab1b7..cc67490 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -530,6 +530,16 @@ def check_sanity_version_change(status, d):
tmpdir = d.getVar('TMPDIR', True)
status.addresult(check_create_long_filename(tmpdir, "TMPDIR"))
+ # Some third-party software apparently relies on chmod etc. being suid root (!!)
+ import stat
+ suid_check_bins = "chown chmod mknod".split()
+ for bin_cmd in suid_check_bins:
+ bin_path = bb.utils.which(os.environ["PATH"], bin_cmd)
+ if bin_path:
+ bin_stat = os.stat(bin_path)
+ if bin_stat.st_uid == 0 and bin_stat.st_mode & stat.S_ISUID:
+ status.addresult('%s has the setuid bit set. This interferes with pseudo and may cause other issues that break the build process.\n' % bin_path)
+
# Check that we can fetch from various network transports
netcheck = check_connectivity(d)
status.addresult(netcheck)
OpenPOWER on IntegriCloud