diff options
| -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 | ||
