Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Scott Garman <scott.a.garman@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [CONSOLIDATED PULL 19/26] insane.bbclass: add QA tests for unsafe references to exec_prefix
Date: Thu, 22 Dec 2011 08:16:16 -0800	[thread overview]
Message-ID: <4EF357D0.3030005@intel.com> (raw)
In-Reply-To: <1324544544.4492.16.camel@lenovo.internal.reciva.com>

On 12/22/2011 01:02 AM, Phil Blundell wrote:
> On Wed, 2011-12-21 at 23:55 -0800, Saul Wold wrote:
>> +		exec_prefix = d.getVar('exec_prefix', True)
>> +		sysroot_path = d.getVar('STAGING_DIR_TARGET', True)
>> +		sysroot_path_usr = sysroot_path + exec_prefix
>> +
>> +		try:
>> +			ldd_output = sub.check_output(["prelink-rtld", "--root", sysroot_path, path])
>> +		except sub.CalledProcessError as e:
>> +			if e.returncode != 127:
>> +				error_msg = pn + ": prelink-rtld aborted when processing %s" % path
>> +				package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
>> +				return False
>> +			else:
>> +				# Sometimes this is done deliberately (e.g, e2fsprogs), so only warn
>> +				bb.warn("%s has missing library dependencies" % path)
>> +				return
>> +		if sysroot_path_usr in ldd_output:
>> +			error_msg = pn + ": %s links to something under exec_prefix" % path
>> +			package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
>> +			error_msg = "ldd reports: %s" % ldd_output
>> +			package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
>> +			return False
>
> Is that going to do the right thing if ${prefix} == ${exec_prefix}?
> It's not obvious to me that it will handle that case correctly.

The function unsafe_references_skippable checks if exec_prefix == "" and 
also if base_bindir == bindir and base_sbindir == sbindir and 
base_libdir == libdir. Would that cover this case, or should this check 
be made explicit?

Scott

-- 
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center



  reply	other threads:[~2011-12-22 16:23 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-22  7:55 [CONSOLIDATED PULL 00/26] Some Package Updates and Fixes Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 01/26] distro tracking: update man-pages, gts-plugin-bluetooth, usbutils, Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 02/26] python-pycairo: Upgrade to 1.10.0 Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 03/26] augeas: Upgrade to 0.10.0 Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 04/26] libidn: Upgrade to 1.23 Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 05/26] mc: Add version 4.8.1 now GPLv3 Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 06/26] texi2html: Upgrade to 5.0 Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 07/26] libdrm: Upgrade to 2.4.29 Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 08/26] distro_tracking: Mark Upgrade Info Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 09/26] libsync: move to git.yoctoproject.org Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 10/26] socat: add the latest stable version 1.7.2.0 Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 11/26] wget: fix a host intrusion issue introduced by adding --with-ssl=openssl Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 12/26] ncurses: move libraries to base_libdir Saul Wold
2011-12-22  8:50   ` Phil Blundell
2011-12-22 16:12     ` Scott Garman
2011-12-23  5:30       ` Scott Garman
2011-12-23  8:18         ` Paul Eggleton
2011-12-23 17:46           ` Scott Garman
2011-12-22  7:55 ` [CONSOLIDATED PULL 13/26] libcap: move library " Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 14/26] util-linux: move libraries " Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 15/26] e2fsprogs: " Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 16/26] libusb1: " Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 17/26] libusb-compat: " Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 18/26] prelink: update to latest git version Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 19/26] insane.bbclass: add QA tests for unsafe references to exec_prefix Saul Wold
2011-12-22  9:02   ` Phil Blundell
2011-12-22 16:16     ` Scott Garman [this message]
2011-12-22  7:55 ` [CONSOLIDATED PULL 20/26] gmp: Don't check "$CC $CFLAGS" for x32 in gmp configure Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 21/26] bitbake.conf multilib.conf: move the definition of baselib Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 22/26] binutils: fix building on distros with matching binutils version Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 23/26] image-types: add btrfs as a supported fstype Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 24/26] arch-powerpc: set PACKAGE_EXTRA_ARCHS Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 25/26] zypper: add patch from libxml2 Saul Wold
2011-12-22  7:55 ` [CONSOLIDATED PULL 26/26] bash: Add SRC_URI Checksums for GPLv2 Saul Wold
2011-12-22 13:19 ` [CONSOLIDATED PULL 00/26] Some Package Updates and Fixes Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EF357D0.3030005@intel.com \
    --to=scott.a.garman@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox