[oe-commits] Tom Rini : insane.bbclass: Make RPATH a non-fatal error

git version control git at git.openembedded.org
Tue Feb 22 01:33:24 UTC 2011


Module: openembedded.git
Branch: trini/simplify-target-flags
Commit: 6067e6ca9c615108886f4623a74afcfd3e7640d4
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=6067e6ca9c615108886f4623a74afcfd3e7640d4

Author: Tom Rini <tom_rini at mentor.com>
Date:   Sat Feb 19 03:26:27 2011 +0000

insane.bbclass: Make RPATH a non-fatal error

In order to make the user experience better we now use bb.warn
on non-fatal QA errors and bb.error on fatal errors.  Also note
that the RPATH problem is a security issue. (not part of the acks,
but suggested on the ML).

Signed-off-by: Tom Rini <tom_rini at mentor.com>
Acked-by: Khem Raj <raj.khem at gmail.com>
Acked-by: Denys Dmytriyenko <denys at ti.com>
Acked-by: Eric Benard <eric at eukrea.com>

---

 classes/insane.bbclass |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/classes/insane.bbclass b/classes/insane.bbclass
index 529fe0c..7364fb1 100644
--- a/classes/insane.bbclass
+++ b/classes/insane.bbclass
@@ -116,7 +116,7 @@ def package_qa_make_fatal_error(error_class, name, path,d):
 
     TODO: Load a whitelist of known errors
     """
-    return not error_class in [0, 5, 7]
+    return not error_class in [0, 1, 5, 7]
 
 def package_qa_write_error(error_class, name, path, d):
     """
@@ -128,7 +128,7 @@ def package_qa_write_error(error_class, name, path, d):
 
     ERROR_NAMES =[
         "non dev contains .so",
-        "package contains RPATH",
+        "package contains RPATH (security issue!)",
         "package depends on debug package",
         "non dbg contains .debug",
         "wrong architecture",
@@ -145,10 +145,16 @@ def package_qa_write_error(error_class, name, path, d):
              (ERROR_NAMES[error_class], name, package_qa_clean_path(path,d))
     f.close()
 
+# Returns False is there was a fatal problem and True if we did not hit a fatal
+# error
 def package_qa_handle_error(error_class, error_msg, name, path, d):
-    bb.error("QA Issue with %s: %s" % (name, error_msg))
+    fatal = package_qa_make_fatal_error(error_class, name, path, d)
     package_qa_write_error(error_class, name, path, d)
-    return not package_qa_make_fatal_error(error_class, name, path, d)
+    if fatal:
+        bb.error("QA Issue with %s: %s" % (name, error_msg))
+    else:
+        bb.warn("QA Issue with %s: %s" % (name, error_msg))
+    return not fatal
 
 def package_qa_check_rpath(file,name,d, elf):
     """
@@ -173,7 +179,7 @@ def package_qa_check_rpath(file,name,d, elf):
     for line in txt:
         for dir in bad_dirs:
             if dir in line:
-                error_msg = "package %s contains bad RPATH %s in file %s" % (name, line, file)
+                error_msg = "package %s contains bad RPATH %s in file %s, this is a security issue" % (name, line, file)
                 sane = package_qa_handle_error(1, error_msg, name, file, d)
 
     return sane





More information about the Openembedded-commits mailing list