summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2006-01-12 15:34:49 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2006-01-12 15:34:49 +0000
commit15d1bd639b095fe63c164dcb5ba8977e8eecb73b (patch)
treec233e06b20af14146282a48a44846072ed3e756b
parent94483545da687d9dba81175575d07ba9f77a3eb5 (diff)
Relevant BUGIDs: none
Purpose of commit: new feature Commit summary: --------------- 2006-01-12 Thorsten Kukuk <kukuk@thkukuk.de> * configure.in: Add check for -fpie/-pie * modules/pam_filter/upperLOWER/Makefile.am: Compile/link upperLOWER with -fpie/-pie if supported. * modules/pam_unix/Makefile.am: Compile/link unix_chkpwd with -fpie/-pie if supported.
-rw-r--r--ChangeLog8
-rw-r--r--NEWS3
-rw-r--r--configure.in30
-rw-r--r--modules/pam_filter/upperLOWER/Makefile.am4
-rw-r--r--modules/pam_unix/Makefile.am3
5 files changed, 44 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 05adc4fa..6a0cb63a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-01-12 Thorsten Kukuk <kukuk@thkukuk.de>
+
+ * configure.in: Add check for -fpie/-pie
+ * modules/pam_filter/upperLOWER/Makefile.am: Compile/link
+ upperLOWER with -fpie/-pie if supported.
+ * modules/pam_unix/Makefile.am: Compile/link unix_chkpwd
+ with -fpie/-pie if supported.
+
2006-01-12 Steve Grubb <sgrubb@redhat.com>
* configure.in: Add check for audit library.
diff --git a/NEWS b/NEWS
index 12404325..fdf79ef9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,10 @@
Linux-PAM NEWS -- history of user-visible changes.
* Fix NULL pointer checks in libpam.so
-* pam_succeed_if, pam_group, pam_time: Support netgroup matching.
+* pam_succeed_if, pam_group, pam_time: Support netgroup matching
* New translations for: nb, hu
* Audit PAM calls if Linux Audit is available
+* Compile upperLOWER and unix_chkpwd as PIE binaries
Release 0.99.2.1
diff --git a/configure.in b/configure.in
index de800a62..0b0b18f2 100644
--- a/configure.in
+++ b/configure.in
@@ -142,6 +142,36 @@ AM_CONDITIONAL([HAVE_VERSIONING],
[test "$libc_cv_ld_version_script_option" = "yes"])
dnl
+dnl check for -fPIE/-pie support
+dnl
+AC_ARG_ENABLE(pie,AS_HELP_STRING([--disable-pie],
+ [Disable position-independent executeables (PIE)]),
+ USE_PIE=$enableval, USE_PIE=yes)
+
+AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
+ cat > conftest.c <<EOF
+int foo;
+main () { return 0;}
+EOF
+ if test "$USE_PIE" = "yes" &&
+ AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fpie
+ -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
+ then
+ libc_cv_fpie=yes
+ PIE_CFLAGS="-fpie"
+ PIE_LDFLAGS="-pie"
+ else
+ libc_cv_fpie=no
+ PIE_CFLAGS=""
+ PIE_LDFLAGS=""
+ fi
+ rm -f conftest*])
+AC_SUBST(libc_cv_fpie)
+AC_SUBST(PIE_CFLAGS)
+AC_SUBST(PIE_LDFLAGS)
+
+
+dnl
dnl options and defaults
dnl
diff --git a/modules/pam_filter/upperLOWER/Makefile.am b/modules/pam_filter/upperLOWER/Makefile.am
index bcaaa81a..205429c8 100644
--- a/modules/pam_filter/upperLOWER/Makefile.am
+++ b/modules/pam_filter/upperLOWER/Makefile.am
@@ -8,7 +8,7 @@ securelibfilterdir = $(SECUREDIR)/pam_filter
AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include \
- -I$(srcdir)/..
-AM_LDFLAGS = -L$(top_builddir)/libpam -lpam
+ -I$(srcdir)/.. @PIE_CFLAGS@
+AM_LDFLAGS = @PIE_LDFLAGS@ -L$(top_builddir)/libpam -lpam
securelibfilter_PROGRAMS = upperLOWER
diff --git a/modules/pam_unix/Makefile.am b/modules/pam_unix/Makefile.am
index fe884e77..fa7f4139 100644
--- a/modules/pam_unix/Makefile.am
+++ b/modules/pam_unix/Makefile.am
@@ -45,4 +45,5 @@ bigcrypt_SOURCES = bigcrypt.c bigcrypt_main.c
bigcrypt_CFLAGS = $(AM_CFLAGS)
unix_chkpwd_SOURCES = unix_chkpwd.c md5_good.c md5_broken.c bigcrypt.c
-unix_chkpwd_CFLAGS = $(AM_CFLAGS)
+unix_chkpwd_CFLAGS = $(AM_CFLAGS) @PIE_CFLAGS@
+unix_chkpwd_LDFLAGS = @PIE_LDFLAGS@