2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 14:25:52 +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:
Steve Beattie
2007-08-16 04:19:54 +00:00
parent 0c9d1c44ed
commit bda571d643
4 changed files with 19 additions and 7 deletions

View File

@@ -22,7 +22,7 @@ Summary: A utility library for AppArmor
-
%package -n libapparmor-devel
Requires: %{name} = %{version}
Requires: %{name} = %{version}-%{release}
Group: Development/Libraries/C and C++
Provides: libapparmor:/usr/include/sys/apparmor.h
Summary: -
@@ -50,7 +50,7 @@ Summary: -
%build
./configure --prefix=%{_prefix} --libdir=%{_libdir} --with-perl
make
make CFLAGS="${RPM_OPT_FLAGS}"
%install
make install DESTDIR="$RPM_BUILD_ROOT"
@@ -100,6 +100,8 @@ rm -rf "$RPM_BUILD_ROOT"
%{perl_vendorarch}/LibAppArmor.pm
%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

View File

@@ -16,10 +16,10 @@ lib_LTLIBRARIES = libapparmor.la libimmunix.la
noinst_HEADERS = grammar.h parser.h scanner.h
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
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

View File

@@ -21,7 +21,12 @@
#include <errno.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 fd, ret, len = 0, ctlerr = 0;
@@ -83,3 +88,8 @@ out:
}
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);

View File

@@ -12,4 +12,4 @@ APPARMOR_1.0 {
free_record;
local:
*;
};
} IMMUNIX_1.0;