telnet(1): Disable PAM for the rescue version
authorAaron LI <aly@aaronly.me>
Thu, 5 Jul 2018 09:04:51 +0000 (17:04 +0800)
committerAaron LI <aly@aaronly.me>
Thu, 5 Jul 2018 09:15:33 +0000 (17:15 +0800)
This avoids several PAM-related libraries when crunching telnet, and
reduces the size by about 200 KB.

initrd/rescue.libcrypto/Makefile
lib/libtelnet/Makefile
usr.bin/telnet/Makefile

index aee088f..858d678 100644 (file)
@@ -65,8 +65,7 @@ CRUNCH_LIBS+= -lfetch  # fetch
 CRUNCH_LIBS+= -larchive  # cpio, tar
 CRUNCH_LIBS+= -llzma  # cpio, tar
 CRUNCH_LIBS+= -lbz2  # cpio, tar
-CRUNCH_LIBS+= -lpam -lcrypt -lradius -ltacplus -lopie -lypclnt  # telnet
-CRUNCH_LIBS+= -lprivate_ncurses  # telnet
+CRUNCH_LIBS+= -lprivate_ncurses -lcrypt  # telnet
 CRUNCH_LIBS+= -lprivate_ssl  # fetch, wpa_supplicant
 CRUNCH_LIBS+= -lprivate_ssh  # ssh
 CRUNCH_LIBS+= -lprivate_crypto
index 76ecaa2..580f411 100644 (file)
@@ -12,4 +12,8 @@ WARNS?=               2
 CFLAGS+=       -DENCRYPTION -DAUTHENTICATION -DSRA
 CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 
+.if defined(RESCUE)
+CFLAGS+=       -DNOPAM
+.endif
+
 .include <bsd.lib.mk>
index b82424a..d3b1f9c 100644 (file)
@@ -22,8 +22,14 @@ CFLAGS+=     -I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
 LDFLAGS+=      ${PRIVATELIB_LDFLAGS}
 
 CFLAGS+=       -DENCRYPTION -DAUTHENTICATION
-DPADD+=                ${LIBCRYPTO} ${LIBCRYPT} ${LIBPAM}
-LDADD+=                -lprivate_crypto -lcrypt ${MINUSLPAM}
 CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+DPADD+=                ${LIBCRYPTO} ${LIBCRYPT}
+LDADD+=                -lprivate_crypto -lcrypt
+
+.if !defined(RESCUE)
+# libtelnet requires PAM by default
+DPADD+=                ${LIBPAM}
+LDADD+=                ${MINUSLPAM}
+.endif
 
 .include <bsd.prog.mk>