mirror of
https://github.com/sheumann/telnetd.git
synced 2025-02-19 18:30:30 +00:00
Back out recently-added code that uses mmap.
This commit is contained in:
parent
e8c6388223
commit
cfa9287257
@ -42,7 +42,6 @@ static const char sccsid[] = "@(#)telnetd.c 8.4 (Berkeley) 5/30/95";
|
|||||||
#include "telnetd.h"
|
#include "telnetd.h"
|
||||||
#include "pathnames.h"
|
#include "pathnames.h"
|
||||||
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <paths.h>
|
#include <paths.h>
|
||||||
#include <termcap.h>
|
#include <termcap.h>
|
||||||
@ -763,10 +762,6 @@ telnet(int f, int p, char *host)
|
|||||||
char *HE;
|
char *HE;
|
||||||
char *HN;
|
char *HN;
|
||||||
char *IM;
|
char *IM;
|
||||||
char *IF;
|
|
||||||
char *if_buf;
|
|
||||||
int if_fd = -1;
|
|
||||||
struct stat statbuf;
|
|
||||||
int nfd;
|
int nfd;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -932,13 +927,8 @@ telnet(int f, int p, char *host)
|
|||||||
HE = Getstr("he", &cp);
|
HE = Getstr("he", &cp);
|
||||||
HN = Getstr("hn", &cp);
|
HN = Getstr("hn", &cp);
|
||||||
IM = Getstr("im", &cp);
|
IM = Getstr("im", &cp);
|
||||||
IF = Getstr("if", &cp);
|
|
||||||
if (HN && *HN)
|
if (HN && *HN)
|
||||||
(void) strlcpy(host_name, HN, sizeof(host_name));
|
(void) strlcpy(host_name, HN, sizeof(host_name));
|
||||||
if (IF) {
|
|
||||||
if_fd = open(IF, O_RDONLY, 000);
|
|
||||||
IM = 0;
|
|
||||||
}
|
|
||||||
if (IM == 0)
|
if (IM == 0)
|
||||||
IM = strdup("");
|
IM = strdup("");
|
||||||
} else {
|
} else {
|
||||||
@ -948,17 +938,6 @@ telnet(int f, int p, char *host)
|
|||||||
edithost(HE, host_name);
|
edithost(HE, host_name);
|
||||||
if (hostinfo && *IM)
|
if (hostinfo && *IM)
|
||||||
putf(IM, ptyibuf2);
|
putf(IM, ptyibuf2);
|
||||||
if (IF && if_fd != -1) {
|
|
||||||
if (fstat(if_fd, &statbuf) != -1 && statbuf.st_size > 0) {
|
|
||||||
if_buf = (char *) mmap (0, statbuf.st_size,
|
|
||||||
PROT_READ, 0, if_fd, 0);
|
|
||||||
if (if_buf != MAP_FAILED) {
|
|
||||||
putf(if_buf, ptyibuf2);
|
|
||||||
munmap(if_buf, statbuf.st_size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close (if_fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pcc)
|
if (pcc)
|
||||||
(void) strncat(ptyibuf2, ptyip, pcc+1);
|
(void) strncat(ptyibuf2, ptyip, pcc+1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user