diff options
| author | Kris Kennaway <kris@FreeBSD.org> | 2002-10-19 10:27:25 +0000 |
|---|---|---|
| committer | Kris Kennaway <kris@FreeBSD.org> | 2002-10-19 10:27:25 +0000 |
| commit | 15a79b97ac258fdb0b7309d00ef5bffcf8ac2f4b (patch) | |
| tree | 5ba15972212caa0369ff0205d7dd28ddf944be9d /net/SSLtelnet/files/patch-af | |
| parent | 95c138df21555c3d5ad504233555afa358a9bf6e (diff) | |
Re-add SSLtelnet, with patch (patch-an) to fix the security vulnerability
described in FreeBSD-SA-01:49.telnetd
Submitted by: kondo hiroshi <kondo@ysyslab.co.jp>
PR: ports/42676
Diffstat (limited to 'net/SSLtelnet/files/patch-af')
| -rw-r--r-- | net/SSLtelnet/files/patch-af | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/net/SSLtelnet/files/patch-af b/net/SSLtelnet/files/patch-af new file mode 100644 index 000000000000..0540f99f62cf --- /dev/null +++ b/net/SSLtelnet/files/patch-af @@ -0,0 +1,79 @@ +--- telnetd/sys_term.c.orig Sat Aug 2 01:37:00 1997 ++++ telnetd/sys_term.c Sun Aug 6 16:15:37 2000 +@@ -167,7 +167,7 @@ + struct termios termbuf, termbuf2; /* pty control structure */ + #endif /* USE_TERMIO */ + +-extern long time(); ++extern time_t time(); + + #ifndef STDIN_FILENO + #define STDIN_FILENO fileno(stdin) +@@ -531,7 +531,7 @@ + return(p); + #else + +- register char c, *p1, *p2; ++ register char c, *p1, *p2, *cp; + register int i; + + #if defined(__GNUC__) || defined(__sgi) +@@ -548,20 +548,40 @@ + p1 = &line[8]; + p2 = &line[9]; + #endif +- +- for (c = 'p'; c <= 's'; c++) { ++ for (cp = "pqrsPQRS"; *cp; cp++) { + struct stat stb; + +- *p1 = c; ++ *p1 = *cp; + *p2 = '0'; ++ /* ++ * This stat() check is just to keep us from ++ * looping through all 256 combinations if there ++ * aren't that many ptys available. ++ */ + if (stat(line, &stb) < 0) + break; +- for (i = 0; i < 16; i++) { +- *p2 = "0123456789abcdef"[i]; ++ for (i = 0; i < 32; i++) { ++ *p2 = "0123456789abcdefghijklmnopqrstuv"[i]; + p = open(line, 2); + if (p > 0) { ++#ifndef __hpux + line[5] = 't'; +- return(p); ++#else ++ for (p1 = &line[8]; *p1; p1++) ++ *p1 = *(p1+1); ++ line[9] = 't'; ++#endif ++ chown(line, 0, 0); ++ chmod(line, 0600); ++#if defined(sun) && defined(TIOCGPGRP) && BSD < 199207 ++ if (ioctl(p, TIOCGPGRP, &dummy) == 0 ++ || errno != EIO) { ++ chmod(line, 0666); ++ close(p); ++ line[5] = 'p'; ++ } else ++#endif /* defined(sun) && defined(TIOCGPGRP) && BSD < 199207 */ ++ return(p); + } + } + } +@@ -733,11 +753,7 @@ + else + termbuf.lflags &= ~LPASS8; + #else +- if (on) { +- termbuf.c_iflag &= ~ISTRIP; +- } else { +- termbuf.c_iflag |= ISTRIP; +- } ++ termbuf.c_iflag &= ~ISTRIP; + #endif + } |
