diff options
author | phk <phk@FreeBSD.org> | 1998-04-26 06:51:36 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1998-04-26 06:51:36 +0000 |
commit | 01c6cd5a654c11300d0374e3f8bed9426e6246fd (patch) | |
tree | 80d76afe7766f840192eab29ca4c3ebb689449ec /libexec/telnetd | |
parent | de32d1b3381d19341c0adf0f1061d190fe6e349a (diff) | |
download | FreeBSD-src-01c6cd5a654c11300d0374e3f8bed9426e6246fd.zip FreeBSD-src-01c6cd5a654c11300d0374e3f8bed9426e6246fd.tar.gz |
telnetd does not recognize the if (display file before login) gettytab flag.
PR: 6365
Reviewed by: phk
Submitted by: Jason Garman <init@risen.org>
Diffstat (limited to 'libexec/telnetd')
-rw-r--r-- | libexec/telnetd/telnetd.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libexec/telnetd/telnetd.c b/libexec/telnetd/telnetd.c index 2944188..7018fdc 100644 --- a/libexec/telnetd/telnetd.c +++ b/libexec/telnetd/telnetd.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)telnetd.c 8.2 (Berkeley) 12/15/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: telnetd.c,v 1.13 1997/12/03 07:16:05 charnier Exp $"; #endif /* not lint */ #include "telnetd.h" @@ -60,6 +60,8 @@ static const char rcsid[] = #include <err.h> #include <arpa/inet.h> +#include <sys/mman.h> + #if defined(_SC_CRAY_SECURE_SYS) #include <sys/sysv.h> #include <sys/secdev.h> @@ -892,6 +894,11 @@ telnet(f, p, host) char *HE; char *HN; char *IM; + char *IF; + char *if_buf; + int if_fd; + struct stat statbuf; + void netflush(); /* @@ -1090,8 +1097,11 @@ telnet(f, p, host) HE = getstr("he", &cp); HN = getstr("hn", &cp); IM = getstr("im", &cp); + IF = getstr("if", &cp); if (HN && *HN) (void) strcpy(host_name, HN); + if (IF && (if_fd = open(IF, O_RDONLY, 000)) != -1) + IM = 0; if (IM == 0) IM = ""; } else { @@ -1101,6 +1111,14 @@ telnet(f, p, host) edithost(HE, host_name); if (hostinfo && *IM) putf(IM, ptyibuf2); + else if (IF && if_fd != -1) { + fstat (if_fd, &statbuf); + if_buf = (char *) mmap (0, statbuf.st_size, PROT_READ, + 0, if_fd, 0); + putf(if_buf, ptyibuf2); + munmap (if_buf, statbuf.st_size); + close (if_fd); + } if (pcc) (void) strncat(ptyibuf2, ptyip, pcc+1); |