mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-01 06:45:38 +00:00
Fix braindead symbol versioning issue where applications that linked
against libapparmor::change_hat would be linking against change_hat@IMMUNIX_1.0 rather than change_hat@APPARMOR_1.0 (the preferred version). Remove -module to prevent linking portability warning when building mod_apparmor. Use RPM_OPT_FLAGS for CFLAGS when building rpms.
This commit is contained in:
@@ -22,7 +22,7 @@ Summary: A utility library for AppArmor
|
|||||||
-
|
-
|
||||||
|
|
||||||
%package -n libapparmor-devel
|
%package -n libapparmor-devel
|
||||||
Requires: %{name} = %{version}
|
Requires: %{name} = %{version}-%{release}
|
||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
Provides: libapparmor:/usr/include/sys/apparmor.h
|
Provides: libapparmor:/usr/include/sys/apparmor.h
|
||||||
Summary: -
|
Summary: -
|
||||||
@@ -50,7 +50,7 @@ Summary: -
|
|||||||
|
|
||||||
%build
|
%build
|
||||||
./configure --prefix=%{_prefix} --libdir=%{_libdir} --with-perl
|
./configure --prefix=%{_prefix} --libdir=%{_libdir} --with-perl
|
||||||
make
|
make CFLAGS="${RPM_OPT_FLAGS}"
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make install DESTDIR="$RPM_BUILD_ROOT"
|
make install DESTDIR="$RPM_BUILD_ROOT"
|
||||||
@@ -100,6 +100,8 @@ rm -rf "$RPM_BUILD_ROOT"
|
|||||||
%{perl_vendorarch}/LibAppArmor.pm
|
%{perl_vendorarch}/LibAppArmor.pm
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
-
|
* Wed Aug 15 2007 - sbeattie@suse.de
|
||||||
|
- fix braindead symbol versioning issue with old version name
|
||||||
|
- re-enable CFLAGS=RPM_OPT_FLAGS for build
|
||||||
|
|
||||||
|
|
||||||
|
@@ -16,10 +16,10 @@ lib_LTLIBRARIES = libapparmor.la libimmunix.la
|
|||||||
noinst_HEADERS = grammar.h parser.h scanner.h
|
noinst_HEADERS = grammar.h parser.h scanner.h
|
||||||
|
|
||||||
libapparmor_la_SOURCES = grammar.y libaalogparse.c change_hat.c scanner.c
|
libapparmor_la_SOURCES = grammar.y libaalogparse.c change_hat.c scanner.c
|
||||||
libapparmor_la_LDFLAGS = -module -version-info 1:0:0 -XCClinker -dynamic \
|
libapparmor_la_LDFLAGS = -version-info 1:0:0 -XCClinker -dynamic \
|
||||||
-Wl,--version-script=libapparmor.map -Wl,-soname=libapparmor.so.1
|
-Wl,--version-script=libapparmor.map -Wl,-soname=libapparmor.so.1
|
||||||
|
|
||||||
libimmunix_la_SOURCES = change_hat.c libimmunix_warning.c
|
libimmunix_la_SOURCES = change_hat.c libimmunix_warning.c
|
||||||
libimmunix_la_LDFLAGS = -module -version-info 1:0:0 -Wl,--version-script=libapparmor.map -Wl,-soname=libimmunix.so.1
|
libimmunix_la_LDFLAGS = -version-info 1:0:0 -Wl,--version-script=libapparmor.map -Wl,-soname=libimmunix.so.1
|
||||||
|
|
||||||
EXTRA_DIST = grammar.y scanner.l libapparmor.map
|
EXTRA_DIST = grammar.y scanner.l libapparmor.map
|
||||||
|
@@ -21,7 +21,12 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
int change_hat(char *subprofile, unsigned int token)
|
#define symbol_version(real, name, version) \
|
||||||
|
__asm__ (".symver " #real "," #name "@" #version)
|
||||||
|
#define default_symbol_version(real, name, version) \
|
||||||
|
__asm__ (".symver " #real "," #name "@@" #version)
|
||||||
|
|
||||||
|
int __change_hat(char *subprofile, unsigned int token)
|
||||||
{
|
{
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
int fd, ret, len = 0, ctlerr = 0;
|
int fd, ret, len = 0, ctlerr = 0;
|
||||||
@@ -83,3 +88,8 @@ out:
|
|||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* create an alias for the old change_hat@IMMUNIX_1.0 symbol */
|
||||||
|
extern typeof((__change_hat)) __old_change_hat __attribute__((alias ("__change_hat")));
|
||||||
|
symbol_version(__old_change_hat, change_hat, IMMUNIX_1.0);
|
||||||
|
default_symbol_version(__change_hat, change_hat, APPARMOR_1.0);
|
||||||
|
@@ -12,4 +12,4 @@ APPARMOR_1.0 {
|
|||||||
free_record;
|
free_record;
|
||||||
local:
|
local:
|
||||||
*;
|
*;
|
||||||
};
|
} IMMUNIX_1.0;
|
||||||
|
Reference in New Issue
Block a user