aboutsummaryrefslogtreecommitdiff
path: root/secure/usr.sbin
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2014-11-25 22:25:13 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2014-11-25 22:25:13 +0000
commitff75e00737d1906e8a2c37df4f46332d746c6e1c (patch)
tree2ca51cf79cb4d7e2f55469f7ffebcc4b6df93ca8 /secure/usr.sbin
parent4c5e7118db32d2dd37747423c3882fbf7bccf622 (diff)
downloadsrc-ff75e00737d1906e8a2c37df4f46332d746c6e1c.tar.gz
src-ff75e00737d1906e8a2c37df4f46332d746c6e1c.zip
Reduce overlinking
The framework now ensure by itself that pthread is added to the link chain as the last component if linked to kerberos hence avoid with out any explicit addition prevent issue like CVE-2014-8475
Notes
Notes: svn path=/head/; revision=275083
Diffstat (limited to 'secure/usr.sbin')
-rw-r--r--secure/usr.sbin/sshd/Makefile18
1 files changed, 4 insertions, 14 deletions
diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile
index f95c8c653322..f2c7e362acd4 100644
--- a/secure/usr.sbin/sshd/Makefile
+++ b/secure/usr.sbin/sshd/Makefile
@@ -25,7 +25,8 @@ SRCS+= gss-genr.c
MAN= sshd.8 sshd_config.5
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
-LIBADD= ssh util wrap pam
+# pam should always happen before ssh here for static linking
+LIBADD= pam ssh util wrap
.if ${MK_LDNS} != "no"
CFLAGS+= -DHAVE_LDNS=1
@@ -41,25 +42,14 @@ LIBADD+= bsm
.if ${MK_KERBEROS_SUPPORT} != "no"
CFLAGS+= -include krb5_config.h
-LIBADD+= gssapi_krb5 gssapi krb5 hx509 asn1 com_err roken wind heimbase \
- heimipcc
+LIBADD+= gssapi_krb5 gssapi krb5
.endif
.if ${MK_OPENSSH_NONE_CIPHER} != "no"
CFLAGS+= -DNONE_CIPHER_ENABLED
.endif
-LIBADD+= crypt crypto z
-
-# Fix the order of NEEDED entries for libthr and libc. The libthr
-# needs to interpose libc symbols, leaving the libthr loading as
-# dependency of krb causes reversed order and broken interposing. Put
-# the threading library last on the linker command line, just before
-# the -lc added by a compiler driver.
-# XXX In theory the framework now takes care of that, it needs to be checked
-.if ${MK_KERBEROS_SUPPORT} != "no"
-LIBADD+= pthread
-.endif
+LIBADD+= crypto
.if defined(LOCALBASE)
CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\"