blob: d51ebb0030451ee3eae459d3628c3239584d3364 (
plain)
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
|
/* $OpenBSD: main.c,v 1.5 2003/12/02 05:48:48 mickey Exp $ */
/*
* Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain
*/
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
int do_pipe(void);
int check_inheritance(void);
int do_process(void);
int do_random(void);
int do_pty(void);
int do_tun(void);
int
main(int argc, char **argv)
{
extern char *__progname;
int ret, c;
ret = 0;
while ((c = getopt(argc, argv, "fPprTt")) != -1) {
switch (c) {
case 'p':
ret |= do_pipe();
break;
case 'f':
ret |= check_inheritance();
break;
case 'P':
ret |= do_process();
break;
case 'r':
ret |= do_random();
break;
case 't':
ret |= do_tun();
break;
case 'T':
ret |= do_pty();
break;
default:
fprintf(stderr, "Usage: %s -[fPprTt]\n", __progname);
exit(1);
}
}
return (ret);
}
|