[openscap/f19] Do not rely on symlinks when openning a library

Šimon Lukašík isimluk at fedoraproject.org
Mon Nov 25 11:15:43 UTC 2013


commit 5989e7edf8d3d9739832ec71ae39e5fbfaf8c93b
Author: Simon Lukasik <slukasik at redhat.com>
Date:   Sun Nov 24 20:24:13 2013 +0100

    Do not rely on symlinks when openning a library
    
    The symlink libopenscap_sce.so is supposed to be consumed
    by linker, but not by a run-time. The symlink is not assured
    to point-out to the latest shared object (otherwise libtool
    authors would not introduced such symlink).
    
    This fix should enable use of SCE without openscap-engine-sce-devel
    package installed.
    
    (cherry picked from commit 49360006309de3946101738578e09cfb9784aa7a)

 ...bopenscap_sce.so.-current-age--explicitly.patch |   44 ++++++++++++++++++++
 openscap.spec                                      |    8 +++-
 2 files changed, 51 insertions(+), 1 deletions(-)
---
diff --git a/0001-dlopen-libopenscap_sce.so.-current-age--explicitly.patch b/0001-dlopen-libopenscap_sce.so.-current-age--explicitly.patch
new file mode 100644
index 0000000..ca620b3
--- /dev/null
+++ b/0001-dlopen-libopenscap_sce.so.-current-age--explicitly.patch
@@ -0,0 +1,44 @@
+diff -uNr openscap-1.0.0/configure openscap-1.0.0.plugin/configure
+--- openscap-1.0.0/configure	2013-11-19 11:36:09.502896274 +0100
++++ openscap-1.0.0.plugin/configure	2013-11-21 16:21:43.288454538 +0100
+@@ -799,6 +799,7 @@
+ ENV_PRESENT_FALSE
+ ENV_PRESENT_TRUE
+ HAVE_ENV
++LT_CURRENT_MINUS_AGE
+ LT_AGE
+ LT_REVISION
+ LT_CURRENT
+@@ -22730,11 +22731,20 @@
+ ## precedence over adding, so set to 0 if both happened.
+ LT_AGE=0
+ 
++LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
+ 
+ 
+ 
+ 
+ 
++
++
++cat >>confdefs.h <<_ACEOF
++#define LT_CURRENT_MINUS_AGE $LT_CURRENT_MINUS_AGE
++_ACEOF
++
++
++
+ 
+ 
+ # Compiler flags
+diff -uNr openscap-1.0.0/src/XCCDF_POLICY/check_engine_plugin.c openscap-1.0.0.plugin/src/XCCDF_POLICY/check_engine_plugin.c
+--- openscap-1.0.0/src/XCCDF_POLICY/check_engine_plugin.c	2013-11-10 08:54:47.459067475 +0100
++++ openscap-1.0.0.plugin/src/XCCDF_POLICY/check_engine_plugin.c	2013-11-21 16:22:57.369464028 +0100
+@@ -184,7 +184,7 @@
+ 	return (plugin->get_capabilities_fn)(&plugin->user_data);
+ }
+ 
+-const char * const known_plugins[] = {"libopenscap_sce.so", NULL};
++const char * const known_plugins[] = {"libopenscap_sce.so." STRINGIZE(LT_CURRENT_MINUS_AGE), NULL};
+ 
+ const char * const *check_engine_plugin_get_known_plugins(void)
+ {
diff --git a/openscap.spec b/openscap.spec
index 5d91d60..da1e9bd 100644
--- a/openscap.spec
+++ b/openscap.spec
@@ -6,12 +6,13 @@ restorecon -R /usr/bin/oscap /usr/libexec/openscap; \
 
 Name:           openscap
 Version:        1.0.0
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Set of open source libraries enabling integration of the SCAP line of standards
 Group:          System Environment/Libraries
 License:        LGPLv2+
 URL:            http://www.open-scap.org/
 Source0:        http://fedorahosted.org/releases/o/p/openscap/%{name}-%{version}.tar.gz
+Patch0:         0001-dlopen-libopenscap_sce.so.-current-age--explicitly.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  swig libxml2-devel libxslt-devel perl-XML-Parser
 BuildRequires:  rpm-devel
@@ -147,6 +148,7 @@ This package installs and sets up the  SELinux policy security module for opensc
 
 %prep
 %setup -q
+%patch0 -p1 -b .plugin
 
 %build
 %ifarch sparc64
@@ -306,6 +308,10 @@ exit 0
 # %{_mandir}/man8/openscap_selinux.8.*
 
 %changelog
+* Thu Nov 21 2013 Šimon Lukašík <slukasik at redhat.com> - 1.0.0-2
+- dlopen libopenscap_sce.so.{current-age} explicitly
+  That allows for SCE to work without openscap-engine-sce-devel
+
 * Tue Nov 19 2013 Šimon Lukašík <slukasik at redhat.com> - 1.0.0-1
 - upgrade
 - package openscap-engine-sce-devel separately


More information about the scm-commits mailing list