mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-23 22:41:10 +01:00
225c0f4b44
Some time ago I got some reports MPSAFE TTY broke telnetd(8). Even though it turned out to be a different problem within the TTY code, I spotted a small issue with telnetd(8). Instead of allocating PTY's using openpty(3) or posix_openpt(2), it used its own PTY allocation routine. This means that telnetd(8) still uses /dev/ptyXX-style devices. I've also increased the size of line[]. Even though 16 should be enough, we already use 13 bytes ("/dev/pts/999", including '\0'). 32 bytes gives us a little more freedom. Also enable -DSTREAMSPTY. Otherwise telnetd(8) strips the PTY's pathname to the latest slash instead of just removing "/dev/" (e.g. /dev/pts/0 -> 0, instead of pts/0). Reviewed by: rink
51 lines
1.1 KiB
Makefile
51 lines
1.1 KiB
Makefile
# $FreeBSD$
|
|
|
|
# Do not define -DKLUDGELINEMODE, as it does not interact well with many
|
|
# telnet implementations.
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
TELNETDIR= ${.CURDIR}/../../contrib/telnet
|
|
.PATH: ${TELNETDIR}/telnetd
|
|
|
|
PROG= telnetd
|
|
MAN= telnetd.8
|
|
|
|
SRCS= global.c slc.c state.c sys_term.c telnetd.c \
|
|
termstat.c utility.c
|
|
|
|
WARNS?= 2
|
|
WFORMAT?= 0
|
|
|
|
CFLAGS+= -DLINEMODE -DUSE_TERMIO -DDIAGNOSTICS -DOLD_ENVIRON \
|
|
-DENV_HACK -DSTREAMSPTY
|
|
|
|
.if ${MK_INET6_SUPPORT} != "no"
|
|
CFLAGS+= -DINET6
|
|
.endif
|
|
|
|
CFLAGS+= -I${TELNETDIR}
|
|
|
|
LIBTELNET= ${.OBJDIR}/../../lib/libtelnet/libtelnet.a
|
|
|
|
DPADD= ${LIBUTIL} ${LIBTERMCAP} ${LIBTELNET}
|
|
LDADD= -lutil -ltermcap ${LIBTELNET}
|
|
|
|
# XXX for src/release/picobsd
|
|
.if !defined(RELEASE_CRUNCH)
|
|
.if ${MK_OPENSSL} != "no"
|
|
SRCS+= authenc.c
|
|
CFLAGS+= -DAUTHENTICATION -DENCRYPTION
|
|
DPADD+= ${LIBMP} ${LIBCRYPTO} ${LIBCRYPT} ${LIBPAM}
|
|
LDADD+= -lmp -lcrypto -lcrypt ${MINUSLPAM}
|
|
.endif
|
|
|
|
.if ${MK_KERBEROS_SUPPORT} != "no"
|
|
CFLAGS+= -DKRB5 -DFORWARD -Dnet_write=telnet_net_write
|
|
DPADD+= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBROKEN} ${LIBCOM_ERR}
|
|
LDADD+= -lkrb5 -lhx509 -lasn1 -lroken -lcom_err
|
|
.endif
|
|
.endif
|
|
|
|
.include <bsd.prog.mk>
|