diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2015-09-18 17:15:22 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-23 09:52:59 +0100 |
commit | 10fb575d614b26d773343dd7b6cbe45d23557279 (patch) | |
tree | b01a3e74956a9c65ff3fbf256325afb63c1b42a8 | |
parent | 56248899824a196e0dd7add42d0a00f0c32cc342 (diff) | |
download | poky-10fb575d614b26d773343dd7b6cbe45d23557279.tar.gz |
insane.bbclass: show PN and relative path in package_qa_check_host_user
* show PN as other QA checks
* strip PKGDEST prefix from shown path as other QA checks
(From OE-Core rev: 39b1bca459d52b58ca055604b5012d9a411e3a59)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/insane.bbclass | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 5c8629af1d..c984faec71 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
@@ -980,6 +980,7 @@ def package_qa_check_host_user(path, name, d, elf, messages): | |||
980 | return | 980 | return |
981 | 981 | ||
982 | dest = d.getVar('PKGDEST', True) | 982 | dest = d.getVar('PKGDEST', True) |
983 | pn = d.getVar('PN', True) | ||
983 | home = os.path.join(dest, 'home') | 984 | home = os.path.join(dest, 'home') |
984 | if path == home or path.startswith(home + os.sep): | 985 | if path == home or path.startswith(home + os.sep): |
985 | return | 986 | return |
@@ -991,14 +992,15 @@ def package_qa_check_host_user(path, name, d, elf, messages): | |||
991 | if exc.errno != errno.ENOENT: | 992 | if exc.errno != errno.ENOENT: |
992 | raise | 993 | raise |
993 | else: | 994 | else: |
995 | rootfs_path = path[len(dest):] | ||
994 | check_uid = int(d.getVar('HOST_USER_UID', True)) | 996 | check_uid = int(d.getVar('HOST_USER_UID', True)) |
995 | if stat.st_uid == check_uid: | 997 | if stat.st_uid == check_uid: |
996 | messages["host-user-contaminated"] = "%s is owned by uid %d, which is the same as the user running bitbake. This may be due to host contamination" % (path, check_uid) | 998 | messages["host-user-contaminated"] = "%s: %s is owned by uid %d, which is the same as the user running bitbake. This may be due to host contamination" % (pn, rootfs_path, check_uid) |
997 | return False | 999 | return False |
998 | 1000 | ||
999 | check_gid = int(d.getVar('HOST_USER_GID', True)) | 1001 | check_gid = int(d.getVar('HOST_USER_GID', True)) |
1000 | if stat.st_gid == check_gid: | 1002 | if stat.st_gid == check_gid: |
1001 | messages["host-user-contaminated"] = "%s is owned by gid %d, which is the same as the user running bitbake. This may be due to host contamination" % (path, check_gid) | 1003 | messages["host-user-contaminated"] = "%s: %s is owned by gid %d, which is the same as the user running bitbake. This may be due to host contamination" % (pn, rootfs_path, check_gid) |
1002 | return False | 1004 | return False |
1003 | return True | 1005 | return True |
1004 | 1006 | ||