Accepting request 103053 from home:dlovasko:branches:Base:System

fixed bnc#743145 - added -fpie/-pie flags to compilation and linking of polkit-agent-helper and pkexec

OBS-URL: https://build.opensuse.org/request/show/103053
OBS-URL: https://build.opensuse.org/package/show/Base:System/polkit?expand=0&rev=59
This commit is contained in:
Marcus Meissner 2012-02-09 17:05:33 +00:00 committed by Git OBS Bridge
parent 3b3aa2096e
commit e12f7f91c0
3 changed files with 99 additions and 1 deletions

90
polkit-pie.patch Normal file
View File

@ -0,0 +1,90 @@
Index: polkit-0.104/src/programs/Makefile.am
===================================================================
--- polkit-0.104.orig/src/programs/Makefile.am
+++ polkit-0.104/src/programs/Makefile.am
@@ -26,12 +26,14 @@ pkexec_SOURCES = pkexec.c
pkexec_CFLAGS = \
$(GLIB_CFLAGS) \
$(AUTH_LIBS) \
+ -fPIE \
$(NULL)
pkexec_LDADD = \
$(GLIB_LIBS) \
$(top_builddir)/src/polkit/libpolkit-gobject-1.la \
$(top_builddir)/src/polkitagent/libpolkit-agent-1.la \
+ -pie \
$(NULL)
# ----------------------------------------------------------------------------------------------------
Index: polkit-0.104/src/polkitagent/Makefile.am
===================================================================
--- polkit-0.104.orig/src/polkitagent/Makefile.am
+++ polkit-0.104/src/polkitagent/Makefile.am
@@ -64,6 +64,7 @@ libpolkit_agent_1_la_SOURCES =
$(NULL)
libpolkit_agent_1_la_CFLAGS = \
+ -fpie \
-D_POLKIT_COMPILATION \
-D_POLKIT_AGENT_COMPILATION \
$(GLIB_CFLAGS) \
@@ -75,7 +76,7 @@ libpolkit_agent_1_la_LIBADD =
$(EXPAT_LIBS) \
$(NULL)
-libpolkit_agent_1_la_LDFLAGS = -export-symbols-regex '(^polkit_.*)'
+libpolkit_agent_1_la_LDFLAGS = -pie -export-symbols-regex '(^polkit_.*)'
libexec_PROGRAMS = polkit-agent-helper-1
@@ -93,7 +94,10 @@ endif
polkit_agent_helper_1_CFLAGS = \
-D_POLKIT_COMPILATION \
$(GLIB_CFLAGS) \
+ -fpie \
$(NULL)
+
+polkit_agent_helper_1_LDFLAGS = -pie
polkit_agent_helper_1_LDADD = \
$(AUTH_LIBS) \
Index: polkit-0.104/src/programs/Makefile.in
===================================================================
--- polkit-0.104.orig/src/programs/Makefile.in
+++ polkit-0.104/src/programs/Makefile.in
@@ -76,7 +76,7 @@ pkexec_DEPENDENCIES = $(am__DEPENDENCIES
$(am__DEPENDENCIES_1)
pkexec_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(pkexec_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
+ $(AM_LDFLAGS) $(pkexec_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -304,7 +304,10 @@ pkexec_SOURCES = pkexec.c
pkexec_CFLAGS = \
$(GLIB_CFLAGS) \
$(AUTH_LIBS) \
+ -fpie \
$(NULL)
+
+pkexec_LDFLAGS = -pie
pkexec_LDADD = \
$(GLIB_LIBS) \
Index: polkit-0.104/src/polkitagent/Makefile.in
===================================================================
--- polkit-0.104.orig/src/polkitagent/Makefile.in
+++ polkit-0.104/src/polkitagent/Makefile.in
@@ -113,8 +113,8 @@ polkit_agent_helper_1_DEPENDENCIES = $(a
$(am__DEPENDENCIES_1)
polkit_agent_helper_1_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
- $(polkit_agent_helper_1_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
+ $(polkit_agent_helper_1_CFLAGS) -fpie $(CFLAGS) $(AM_LDFLAGS) \
+ $(polkit_agent_helper_1_LDFLAGS) -pie $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Feb 7 14:39:43 UTC 2012 - dlovasko@suse.com
- fixed bnc#743145 - added -fpie/-pie flags to compilation and linking of polkit-agent-helper and pkexec
-------------------------------------------------------------------
Mon Jan 9 09:33:30 UTC 2012 - vuntz@opensuse.org

View File

@ -15,6 +15,7 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define with_systemd 0
Name: polkit
@ -29,6 +30,7 @@ Source0: http://hal.freedesktop.org/releases/%{name}-%{version}.tar.gz
Source99: baselibs.conf
# PATCH-FIX-OPENSUSE polkit-no-wheel-group.patch vuntz@opensuse.org -- In openSUSE, there's no special meaning for the wheel group, so we shouldn't allow it to be admin
Patch0: polkit-no-wheel-group.patch
Patch1: polkit-pie.patch
BuildRequires: glib2-devel >= 2.25.12
BuildRequires: gobject-introspection-devel >= 0.6.2
BuildRequires: gtk-doc
@ -102,6 +104,7 @@ This package provides the GObject Introspection bindings for PolicyKit.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%build
export V=1
@ -112,7 +115,7 @@ export V=1
--enable-introspection \
--enable-examples \
--libexecdir=%{_prefix}/lib/polkit-1
make %{?_smp_mflags}
make CFLAGS="-fPIC" %{?_smp_mflags}
%install
make install DESTDIR=$RPM_BUILD_ROOT