Skip to content

Commit

Permalink
Build pt_chown as PIE.
Browse files Browse the repository at this point in the history
(cherry picked from commit f051ddf)
  • Loading branch information
Ulrich Drepper authored and Andreas Schwab committed Aug 4, 2009
1 parent a780093 commit c87c885
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2009-06-16 Ulrich Drepper <drepper@redhat.com>

* login/Makefile: Build pt_chown as PIE.

2009-06-16 Ulrich Drepper <drepper@redhat.com>

* login/Makefile: If necessary link pt_chown with -lcap.
Expand Down
13 changes: 13 additions & 0 deletions login/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,23 @@ otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
$(resolvobjdir)/libresolv.a $(common-objpfx)libc.a
endif

ifeq (yesyes,$(have-fpie)$(build-shared))
pt_chown-cflags += $(pie-ccflag)
endif
ifeq (yes,$(have-ssp))
pt_chown-cflags += -fstack-protector
endif
ifeq (yes,$(have-libcap))
libcap = -lcap
endif
CFLAGS-pt_chown.c = $(pt_chown-cflags)
LDLIBS-pt_chown = $(libcap)
ifeq (yesyes,$(have-fpie)$(build-shared))
LDFLAGS-pt_chown = -Wl,-z,now

$(objpfx)pt_chown: $(objpfx)pt_chown.o
$(+link-pie)
endif

# pt_chown needs to be setuid root.
$(inst_libexecdir)/pt_chown: $(objpfx)pt_chown $(+force)
Expand Down

0 comments on commit c87c885

Please sign in to comment.