From: Jeff Moyer Subject: [patch] make automount daemon a PIE Date: Wed, 24 Mar 2004 17:56:23 -0500 Sender: autofs-bounces@linux.kernel.org Message-ID: <16482.4631.363999.697432@segfault.boston.redhat.com> Reply-To: jmoyer@redhat.com Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: autofs-bounces@linux.kernel.org Content-Type: text/plain; charset="us-ascii" To: autofs@linux.kernel.org Hello, Uli Drepper suggested making automount a position independent executable. Here is a patch which does so on systems with compilers that support it. Ian, I didn't include generated files (ala configure and Makefile.conf) for obvious reasons. Cheers, Jeff diff --exclude configure --exclude Makefile.conf -urp autofs-4.1.1.orig/Makefile.conf.in autofs-4.1.1/Makefile.conf.in --- autofs-4.1.1.orig/Makefile.conf.in 2003-09-29 04:22:35.000000000 -0400 +++ autofs-4.1.1/Makefile.conf.in 2004-03-24 17:37:46.000000000 -0500 @@ -7,6 +7,10 @@ # build autofs. # +# Do we build with -fpie? +DAEMON_CFLAGS = @DAEMON_CFLAGS@ +DAEMON_LDFLAGS = @DAEMON_LDFLAGS@ + # Special parameters for glibc (libc 6) LIBNSL = @LIBNSL@ LIBRESOLV = @LIBRESOLV@ diff --exclude configure --exclude Makefile.conf -urp autofs-4.1.1.orig/configure.in autofs-4.1.1/configure.in --- autofs-4.1.1.orig/configure.in 2004-03-07 07:17:54.000000000 -0500 +++ autofs-4.1.1/configure.in 2004-03-24 17:44:26.000000000 -0500 @@ -126,6 +126,27 @@ AC_SUBST(LIBLDAP) LDFLAGS="${AF_tmp_ldflags}" # +# Does gcc support building position independent executables? +# +AC_PROG_CC +cat > pietest.c <