1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
--- telnetd/pathnames.h.orig Sat Jun 15 17:26:10 1996
+++ telnetd/pathnames.h Sat Oct 17 22:11:51 1998
@@ -53,7 +53,7 @@
/* I'm working on having this work as is with SunOS 5.x */
#ifndef USE_SRALOGIN
#undef _PATH_LOGIN
-#ifdef __bsdi__
+#if defined(__bsdi__) || defined(__FreeBSD__)
#define _PATH_LOGIN "/usr/bin/login"
#else
#define _PATH_LOGIN "/bin/login"
--- telnetd/sys_term.c.orig Sat Aug 2 14:37:00 1997
+++ telnetd/sys_term.c Sat Oct 17 22:11:51 1998
@@ -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
}
--- telnetd/telnetd.c.orig Sat Aug 2 14:40:48 1997
+++ telnetd/telnetd.c Sat Oct 17 22:13:52 1998
@@ -140,7 +140,7 @@
highpty = getnpty();
#endif /* CRAY */
- while ((ch = getopt(argc, argv, "d:a:e:lhnr:I:D:B:sS:a:X:z:")) != EOF) {
+ while ((ch = getopt(argc, argv, "d:a:e:lhnr:I:D:B:sS:a:X:z:q")) != EOF) {
switch(ch) {
#ifdef USE_SSL
@@ -203,6 +203,11 @@
}
break;
+
+ case 'q':
+ ssl_quiet_flag = 1;
+ break;
+
#endif /* USE_SSL */
#ifdef AUTHENTICATE
@@ -584,7 +589,7 @@
#ifdef USE_SSL
/* might as well output something useful here ... */
fprintf(stderr, " [-z ssl] [-z secure] [-z debug] [-z verify=int]\n\t");
- fprintf(stderr, " [-z cert=file] [-z key=file]\n\t");
+ fprintf(stderr, " [-z cert=file] [-z key=file] [-q]\n\t");
#endif /* USE_SSL */
fprintf(stderr, " [port]\n");
exit(1);
@@ -656,7 +661,12 @@
fflush(stderr);
}
- fatal(net,"[SSL required - connection rejected]");
+ if (ssl_quiet_flag) {
+ sleep(1);
+ exit(1);
+ }
+ else
+ fatal(net,"[SSL required - connection rejected]");
}
}
--- telnetd/Makefile.orig Tue Sep 12 10:22:51 1995
+++ telnetd/Makefile Sat Oct 17 22:11:51 1998
@@ -4,16 +4,13 @@
PROG= telnetd
-CFLAGS= -DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO -DAUTHENTICATE -DUSE_SSL \
- -DDIAGNOSTICS -DFILIO_H \
- -I../lib -I../lib/libbsd/include \
+CFLAGS+= -DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO -DAUTHENTICATE -DUSE_SSL \
+ -DDIAGNOSTICS -DFILIO_H -I../lib -I../lib/libbsd/include \
-I$(SSLTOP)/include
LIBS= ../lib/libtelnet/libtelnet.a \
- ../lib/libbsd/libbsd.a \
- ../lib/libutil/libutil.a \
$(SSLTOP)/lib/libssl.a \
- $(SSLTOP)/lib/libcrypto.a
+ $(SSLTOP)/lib/libcrypto.a -lutil
# $(SSLTOP)/lib/libdes.a
OBJS= authenc.o global.o slc.o state.o sys_term.o telnetd.o \
|