diff options
author | Ross Burton <ross.burton@intel.com> | 2014-03-03 20:23:33 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-07 14:58:45 +0000 |
commit | a8dc6aed550f18c290adbc83b64bff009a9ca5e3 (patch) | |
tree | 225599a5d2ec073129226b91b92314bdcc48c88d /meta/classes/insane.bbclass | |
parent | d152d034840158ad18cac82db199a5e5ea2f9781 (diff) | |
download | poky-a8dc6aed550f18c290adbc83b64bff009a9ca5e3.tar.gz |
insane: check packages for absolute symlinks to the tmpdir
Add a sanity test that checks for symlinks in packages that point into the
TMPDIR on the host.
(From OE-Core rev: 9e28808a6d6f47dc10ad87b878c7e912c2bbe16f)
Signed-off-by: Ross Burton <ross.burton@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/insane.bbclass')
-rw-r--r-- | meta/classes/insane.bbclass | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index cf00e12fce..11c1feb84a 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
@@ -574,6 +574,19 @@ def package_qa_check_infodir(path, name, d, elf, messages): | |||
574 | if infodir in path: | 574 | if infodir in path: |
575 | messages.append("The /usr/share/info/dir file is not meant to be shipped in a particular package.") | 575 | messages.append("The /usr/share/info/dir file is not meant to be shipped in a particular package.") |
576 | 576 | ||
577 | QAPATHTEST[symlink-to-sysroot] = "package_qa_check_symlink_to_sysroot" | ||
578 | def package_qa_check_symlink_to_sysroot(path, name, d, elf, messages): | ||
579 | """ | ||
580 | Check that the package doesn't contain any absolute symlinks to the sysroot. | ||
581 | """ | ||
582 | if os.path.islink(path): | ||
583 | target = os.readlink(path) | ||
584 | if os.path.isabs(target): | ||
585 | tmpdir = d.getVar('TMPDIR', True) | ||
586 | if target.startswith(tmpdir): | ||
587 | trimmed = path.replace(os.path.join (d.getVar("PKGDEST", True), name), "") | ||
588 | messages.append("Symlink %s in %s points to TMPDIR" % (trimmed, name)) | ||
589 | |||
577 | def package_qa_check_license(workdir, d): | 590 | def package_qa_check_license(workdir, d): |
578 | """ | 591 | """ |
579 | Check for changes in the license files | 592 | Check for changes in the license files |