1--- tcpclient prints usage message without enough arguments
2tcpclient: usage: tcpclient [ -hHrRdDqQv ] [ -i localip ] [ -p localport ] [ -T timeoutconn ] [ -l localname ] [ -t timeoutinfo ] host port program
3100
4--- tcpclient prints error message with unknown port name
5tcpclient: fatal: unable to figure out port number for nonexistentport
6111
7--- tcpclient prints error message when connection fails
8tcpclient: unable to connect to 127.0.0.1 port 16: connection refused
9111
10--- tcpclient -q does not print error message when connection fails
11111
12--- tcpclient understands empty host name as synonym for 0
13tcpclient: unable to connect to 127.0.0.1 port 16: connection refused
14111
15--- tcpclient understands unbracketed IP address
16tcpclient: unable to connect to 127.0.0.1 port 16: connection refused
17111
18--- tcpclient understands bracketed IP address
19tcpclient: unable to connect to 127.0.0.1 port 16: connection refused
20111
21--- tcpclient prints error message with unknown host name
22tcpclient: fatal: no IP address for nonexistent.local.
23111
24--- tcpclient prints error message with unresolvable host name
25tcpclient: fatal: temporarily unable to figure out IP address for thislabelistoolongbecausednshasalimitof63charactersinasinglelabel.: protocol error
26111
27--- tcpserver prints usage message without enough arguments
28tcpserver: usage: tcpserver [ -1UXpPhHrRoOdDqQv ] [ -c limit ] [ -x rules.cdb ] [ -B banner ] [ -g gid ] [ -u uid ] [ -b backlog ] [ -l localname ] [ -t timeout ] host port program
29100
30--- tcpserver -u 1 attempts to set uid to 1
31tcpserver: fatal: unable to set uid: permission denied
32111
33--- tcpserver -U reads $UID
34tcpserver: fatal: unable to set uid: permission denied
35111
36--- tcpserver -g 2 attempts to set gid to 2
37tcpserver: fatal: unable to set gid: permission denied
38111
39--- tcpserver -U reads $GID
40tcpserver: fatal: unable to set gid: permission denied
41111
42--- tcpserver prints error message with unknown port name
43tcpserver: fatal: unable to figure out port number for nonexistentport
44111
45--- tcpserver prints error message with unknown host name
46tcpserver: fatal: no IP address for nonexistent.local.
47111
48--- tcpserver prints error message with unresolvable host name
49tcpserver: fatal: temporarily unable to figure out IP address for thislabelistoolongbecausednshasalimitof63charactersinasinglelabel.: protocol error
50111
51--- tcpserver prints error message with non-local host name
52tcpserver: fatal: unable to bind: address not available
53111
54--- tcpserver sets basic environment variables
55bannerPROTO=TCP
56TCPLOCALHOST=Local
57TCPLOCALIP=127.0.0.1
58TCPLOCALPORT=50016
59TCPREMOTEHOST=localhost
60TCPREMOTEIP=127.0.0.1
61TCPREMOTEPORT=50017
62TCPREMOTEINFO=unset
630
64--- tcpclient recognizes -D, -i, -r, -h, -t
65bannerPROTO=TCP
66TCPLOCALHOST=Local
67TCPLOCALIP=127.0.0.1
68TCPLOCALPORT=50016
69TCPREMOTEHOST=localhost
70TCPREMOTEIP=127.0.0.1
71TCPREMOTEPORT=50018
72TCPREMOTEINFO=unset
730
74--- tcpclient sets basic environment variables
75PROTO=TCP
76TCPLOCALHOST=Local
77TCPLOCALIP=127.0.0.1
78TCPLOCALPORT=50019
79TCPREMOTEHOST=unset
80TCPREMOTEIP=127.0.0.1
81TCPREMOTEPORT=50016
82TCPREMOTEINFO=unset
830
84--- tcpclient looks up host names properly
85PROTO=TCP
86TCPLOCALHOST=localhost
87TCPLOCALIP=127.0.0.1
88TCPLOCALPORT=50020
89TCPREMOTEHOST=localhost
90TCPREMOTEIP=127.0.0.1
91TCPREMOTEPORT=50016
92TCPREMOTEINFO=unset
930
94--- tcpclient -v works
95tcpclient: connected to 127.0.0.1 port 50016
96ok
970
98--- tcpserver prints error message with used port
99tcpserver: fatal: unable to bind: address already used
100111
101--- tcpcat works
102bannerPROTO=TCP
103TCPLOCALHOST=Local
104TCPLOCALIP=127.0.0.1
105TCPLOCALPORT=50016
106TCPREMOTEHOST=localhost
107TCPREMOTEIP=127.0.0.1
108TCPREMOTEINFO=unset
1090
110--- mconnect works
111bannerPROTO=TCP
112TCPLOCALHOST=Local
113TCPLOCALIP=127.0.0.1
114TCPLOCALPORT=50016
115TCPREMOTEHOST=localhost
116TCPREMOTEIP=127.0.0.1
117TCPREMOTEINFO=unset
1180
119--- tcprules prints usage message without enough arguments
120tcprules: usage: tcprules rules.cdb rules.tmp
121100
122--- tcprules prints error message if it cannot create tmp
123tcprules: fatal: unable to create /dev/nonexistent/tmp: file does not exist
124111
125--- tcprules prints error message if it cannot move tmp to cdb
126tcprules: fatal: unable to move test.tmp to /dev/nonexistent/cdb: file does not exist
127111
128--- tcprules creates a cdb file
1290
130--- tcprulescheck sees deny
131rule 1.2.3.4:
132deny connection
1330
134--- tcprulescheck does not apply deny to another host
135default:
136allow connection
1370
138--- tcprules replaces a cdb file
1390
140--- tcprulescheck finds rule with address and info
141rule joe@127.0.0.1:
142set environment variable which=first
143allow connection
1440
145--- tcprulescheck finds rule with address
146rule 18.23.0.32:
147set environment variable which=second
148allow connection
1490
150--- tcprulescheck finds one-dot wildcard
151rule 127.:
152set environment variable which=third
153allow connection
1540
155--- tcprulescheck finds zero-dot wildcard
156rule :
157set environment variable which=fourth
158allow connection
1590
160--- tcprules handles comments, address ranges, multiple variables
1610
162rule 127.0.:
163set environment variable which=first
164set environment variable where=whatever
165allow connection
166rule 127.1.:
167set environment variable which=first
168set environment variable where=whatever
169allow connection
170rule 127.2.:
171set environment variable which=first
172set environment variable where=whatever
173allow connection
174rule 127.3.:
175set environment variable which=first
176set environment variable where=whatever
177allow connection
178rule 127.4.:
179set environment variable which=first
180set environment variable where=whatever
181allow connection
182rule 127.5.:
183set environment variable which=first
184set environment variable where=whatever
185allow connection
186default:
187allow connection
188default:
189allow connection
190default:
191allow connection
192default:
193allow connection
194default:
195allow connection
196--- tcprules handles host names
1970
198rule =known.edu:
199set environment variable which=known
200allow connection
201rule :
202set environment variable which=anybody
203allow connection
204rule :
205set environment variable which=anybody
206allow connection
207rule =.abuser.edu:
208deny connection
209rule =.abuser.edu:
210deny connection
211--- tcprulescheck searches for rules in the proper order
2120
213rule xyz@86.75.30.9:
214set environment variable which=first
215allow connection
216rule xyz@86.75.30.9:
217set environment variable which=first
218allow connection
219rule xyz@=one.two.three:
220set environment variable which=second
221allow connection
222rule 86.75.30.9:
223set environment variable which=third
224allow connection
225rule 86.75.30.9:
226set environment variable which=third
227allow connection
228rule 86.75.30.9:
229set environment variable which=third
230allow connection
231rule 86.75.30.9:
232set environment variable which=third
233allow connection
234rule =one.two.three:
235set environment variable which=fourth
236allow connection
237rule =one.two.three:
238set environment variable which=fourth
239allow connection
240rule 86.75.30.:
241set environment variable which=fifth
242allow connection
243rule 86.75.30.:
244set environment variable which=fifth
245allow connection
246rule 86.75.:
247set environment variable which=sixth
248allow connection
249rule 86.75.:
250set environment variable which=sixth
251allow connection
252rule 86.75.:
253set environment variable which=sixth
254allow connection
255rule 86.75.:
256set environment variable which=sixth
257allow connection
258rule 86.:
259set environment variable which=seventh
260allow connection
261rule 86.:
262set environment variable which=seventh
263allow connection
264rule 86.:
265set environment variable which=seventh
266allow connection
267rule 86.:
268set environment variable which=seventh
269allow connection
270rule =.two.three:
271set environment variable which=eighth
272allow connection
273rule =.two.three:
274set environment variable which=eighth
275allow connection
276rule =.three:
277set environment variable which=ninth
278allow connection
279rule =.three:
280set environment variable which=ninth
281allow connection
282rule =:
283set environment variable which=tenth
284allow connection
285rule =:
286set environment variable which=tenth
287allow connection
288rule :
289set environment variable which=eleventh
290allow connection
291rule :
292set environment variable which=eleventh
293allow connection
294--- addcr leaves an empty file alone
2950
296--- addcr leaves a partial final line alone
297test0
298--- addcr adds CR after the first line
299test^M
3000
301--- addcr adds CR after the second line
302test^M
303test2^M
3040
305--- addcr handles nulls
306t^@st^M
3070
308--- delcr leaves an empty file alone
3090
310--- delcr leaves a non-CR line alone
311test
3120
313--- delcr removes CR if a line has it
314test
3150
316--- delcr converts CR CR LF to CR LF
317test^M
3180
319--- delcr does not remove CR from a partial final line
320test^M0
321--- delcr handles a non-CR partial final line
322test0
323--- delcr handles nulls
324t^@st
3250
326--- fixcrio works
327^M
328hi^M
329there^M
330bye^M
331--- recordio works
332... < test $
333... > test $
334... < [EOF]$
335... > [EOF]$
336--- recordio handles multiple-line packets
337... < test $
338... < test2 $
339... > test $
340... > test2 $
341... < [EOF]$
342... > [EOF]$
343--- recordio handles partial final lines
344... < test+$
345... > test+$
346... < [EOF]$
347... > [EOF]$
348--- argv0 works
349zero
3500
351--- argv0 requires arguments
352argv0: usage: argv0 realname program [ arg ... ]
353100
354--- rblsmtpd does not find 127.0.0.1 on the RBL
355ok
3560
357--- rblsmtpd finds 127.0.0.2 on the RBL
358rblsmtpd: 127.0.0.2 pid x: 451 Blackholed - see <URL:http://mail-abuse.org/cgi-bin/lookup?127.0.0.2>
359220 rblsmtpd.local^M
360451 Blackholed - see <URL:http://mail-abuse.org/cgi-bin/lookup?127.0.0.2>^M
361221 rblsmtpd.local^M
3620
363--- rblsmtpd -b uses a permanent error code
364rblsmtpd: 127.0.0.2 pid x: 553 Blackholed - see <URL:http://mail-abuse.org/cgi-bin/lookup?127.0.0.2>
365220 rblsmtpd.local^M
366553 Blackholed - see <URL:http://mail-abuse.org/cgi-bin/lookup?127.0.0.2>^M
367221 rblsmtpd.local^M
3680
369--- rblsmtpd quits after a timeout
370rblsmtpd: 127.0.0.2 pid x: 451 Blackholed - see <URL:http://mail-abuse.org/cgi-bin/lookup?127.0.0.2>
371220 rblsmtpd.local^M
3720
373--- rblsmtpd prints an immediate error message with -t0
374rblsmtpd: 127.0.0.2 pid x: 451 Blackholed - see <URL:http://mail-abuse.org/cgi-bin/lookup?127.0.0.2>
375451 Blackholed - see <URL:http://mail-abuse.org/cgi-bin/lookup?127.0.0.2>^M
3760
377--- rblsmtpd understands an empty $RBLSMTPD
378ok
3790
380--- rblsmtpd understands a nonempty $RBLSMTPD
381rblsmtpd: 127.0.0.2 pid x: 451 Error
382220 rblsmtpd.local^M
383451 Error^M
384221 rblsmtpd.local^M
3850
386--- rblsmtpd understands a permanent $RBLSMTPD
387rblsmtpd: 127.0.0.2 pid x: 553 Error
388220 rblsmtpd.local^M
389553 Error^M
390221 rblsmtpd.local^M
3910
392--- rblsmtpd understands -r
393ok
3940
395--- rblsmtpd understands -a
396ok
3970
398--- tcpserver -1v prints proper messages
39950016
400tcpserver: status: 0/2
401tcpserver: status: 1/2
402tcpserver: pid x from 127.0.0.1
403tcpserver: ok x Local:127.0.0.1:50016 localhost:127.0.0.1::x
404tcpserver: end x status 0
405tcpserver: status: 0/2
406tcpserver: status: 1/2
407tcpserver: pid x from 127.0.0.1
408tcpserver: ok x Local:127.0.0.1:50016 localhost:127.0.0.1::x
409tcpserver: end x status 0
410tcpserver: status: 0/2
411tcpserver: status: 1/2
412tcpserver: pid x from 127.0.0.1
413tcpserver: ok x Local:127.0.0.1:50016 localhost:127.0.0.1::x
414tcpserver: end x status 0
415tcpserver: status: 0/2
416tcpserver: status: 1/2
417tcpserver: pid x from 127.0.0.1
418tcpserver: ok x Local:127.0.0.1:50016 localhost:127.0.0.1::x
419tcpserver: end x status 0
420tcpserver: status: 0/2
421tcpserver: status: 1/2
422tcpserver: pid x from 127.0.0.1
423tcpserver: ok x Local:127.0.0.1:50016 localhost:127.0.0.1::x
424tcpserver: end x status 0
425tcpserver: status: 0/2
426tcpserver: status: 1/2
427tcpserver: pid x from 127.0.0.1
428tcpserver: ok x Local:127.0.0.1:50016 localhost:127.0.0.1::x
429tcpserver: end x status 0
430tcpserver: status: 0/2
431tcpserver: status: 1/2
432tcpserver: pid x from 127.0.0.1
433tcpserver: ok x Local:127.0.0.1:50016 localhost:127.0.0.1::x
434tcpserver: end x status 0
435tcpserver: status: 0/2
436