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:57:39 +0000 |
commit | 9e28808a6d6f47dc10ad87b878c7e912c2bbe16f (patch) | |
tree | f1ae71d11fccd435e9dbd85da45de37a75f95d33 /meta/classes/insane.bbclass | |
parent | 3b98de79e14c44e70fd72ed94493a674444bdba2 (diff) | |
download | openembedded-core-9e28808a6d6f47dc10ad87b878c7e912c2bbe16f.tar.gz openembedded-core-9e28808a6d6f47dc10ad87b878c7e912c2bbe16f.tar.bz2 openembedded-core-9e28808a6d6f47dc10ad87b878c7e912c2bbe16f.zip |
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.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
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): if infodir in path: messages.append("The /usr/share/info/dir file is not meant to be shipped in a particular package.") +QAPATHTEST[symlink-to-sysroot] = "package_qa_check_symlink_to_sysroot" +def package_qa_check_symlink_to_sysroot(path, name, d, elf, messages): + """ + Check that the package doesn't contain any absolute symlinks to the sysroot. + """ + if os.path.islink(path): + target = os.readlink(path) + if os.path.isabs(target): + tmpdir = d.getVar('TMPDIR', True) + if target.startswith(tmpdir): + trimmed = path.replace(os.path.join (d.getVar("PKGDEST", True), name), "") + messages.append("Symlink %s in %s points to TMPDIR" % (trimmed, name)) + def package_qa_check_license(workdir, d): """ Check for changes in the license files |