Changeset 1632 for zzuf/trunk
- Timestamp:
- Jan 9, 2007, 11:05:47 AM (16 years ago)
- Location:
- zzuf/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/doc/zzuf.1
r1631 r1632 5 5 \fBzzuf\fR [\fB\-cdiMnqS\fR] [\fB\-r\fR \fIratio\fR] [\fB\-s\fR \fIseed\fR | \fB\-s\fR \fIstart:stop\fR] 6 6 .br 7 [\fB\-F\fR \fIforks\fR] [\fB\-C\fR \fIcrashes\fR] [\fB\- B\fR \fIbytes\fR] [\fB\-T\fR \fIseconds\fR]7 [\fB\-F\fR \fIforks\fR] [\fB\-C\fR \fIcrashes\fR] [\fB\-O\fR \fIbytes\fR] [\fB\-T\fR \fIseconds\fR] 8 8 .br 9 9 [\fB\-P\fR \fIprotect\fR] [\fB\-R\fR \fIrefuse\fR] … … 31 31 interpret them as arguments for itself), eg: 32 32 .PP 33 \fB zzuf \- B1000 cat \-\- \-v /dev/zero\fR33 \fB zzuf \-O 1000 cat \-\- \-v /dev/zero\fR 34 34 .PP 35 35 When no program is specified, \fBzzuf\fR simply fuzzes the standard input, as … … 38 38 \fB zzuf < /dev/zero\fR 39 39 .SH OPTIONS 40 .TP41 \fB\-B\fR, \fB\-\-max\-bytes\fR=\fIn\fR42 Automatically terminate child processes that output more than \fIn\fR bytes43 on the standard output and standard error channels. This is useful to detect44 infinite loops. See also the \fB\-T\fR flag.45 40 .TP 46 41 \fB\-c\fR, \fB\-\-cmdline\fR … … 101 96 \fB\-n\fR, \fB\-\-network\fR 102 97 Fuzz the application's network input. By default \fBzzuf\fR only fuzzes files. 98 .TP 99 \fB\-O\fR, \fB\-\-max\-output\fR=\fIn\fR 100 Automatically terminate child processes that output more than \fIn\fR bytes 101 on the standard output and standard error channels. This is useful to detect 102 infinite loops. See also the \fB\-T\fR flag. 103 103 .TP 104 104 \fB\-P\fR, \fB\-\-protect\fR=\fIlist\fR … … 187 187 Automatically terminate child processes that run for more than \fIn\fR 188 188 seconds. This is useful to detect infinite loops or processes stuck in other 189 situations. See also the \fB\- B\fR flag.189 situations. See also the \fB\-O\fR flag. 190 190 .TP 191 191 \fB\-h\fR, \fB\-\-help\fR -
zzuf/trunk/src/zzuf.c
r1629 r1632 78 78 static int endseed = 1; 79 79 static int quiet = 0; 80 static int max bytes= -1;80 static int maxoutput = -1; 81 81 static int md5 = 0; 82 82 static double maxtime = -1.0; … … 110 110 { 111 111 /* Long option, needs arg, flag, short option */ 112 { "max-bytes", 1, NULL, 'B' },113 112 { "cmdline", 0, NULL, 'c' }, 114 113 { "max-crashes", 1, NULL, 'C' }, … … 120 119 { "md5", 0, NULL, 'M' }, 121 120 { "network", 0, NULL, 'n' }, 121 { "max-output", 1, NULL, 'O' }, 122 122 { "protect", 1, NULL, 'P' }, 123 123 { "quiet", 0, NULL, 'q' }, … … 130 130 { "version", 0, NULL, 'v' }, 131 131 }; 132 int c = getopt_long(argc, argv, " B:cC:dE:F:iI:MnP:qr:R:s:ST:hv",132 int c = getopt_long(argc, argv, "cC:dE:F:iI:MnO:P:qr:R:s:ST:hv", 133 133 long_options, &option_index); 134 134 # else 135 135 # define MOREINFO "Try `%s -h' for more information.\n" 136 int c = getopt(argc, argv, " B:cC:dE:F:iI:MnP:qr:R:s:ST:hv");136 int c = getopt(argc, argv, "cC:dE:F:iI:MnO:P:qr:R:s:ST:hv"); 137 137 # endif 138 138 if(c == -1) … … 141 141 switch(c) 142 142 { 143 case 'B': /* --max-bytes */144 maxbytes = atoi(optarg);145 break;146 143 case 'c': /* --cmdline */ 147 144 cmdline = 1; … … 182 179 case 'n': /* --network */ 183 180 setenv("ZZUF_NETWORK", "1", 1); 181 break; 182 case 'O': /* --max-output */ 183 maxoutput = atoi(optarg); 184 184 break; 185 185 case 'P': /* --protect */ … … 466 466 { 467 467 if(child_list[i].status == STATUS_RUNNING 468 && max bytes >= 0 && child_list[i].bytes > maxbytes)468 && maxoutput >= 0 && child_list[i].bytes > maxoutput) 469 469 { 470 470 fprintf(stdout, "zzuf[seed=%i]: data exceeded, sending SIGTERM\n", … … 675 675 printf("Mandatory arguments to long options are mandatory for short options too.\n"); 676 676 # ifdef HAVE_GETOPT_LONG 677 printf(" -B, --max-bytes <n> kill children that output more than <n> bytes\n");678 677 printf(" -c, --cmdline only fuzz files specified in the command line\n"); 679 678 printf(" -C, --max-crashes <n> stop after <n> children have crashed (default 1)\n"); … … 685 684 printf(" -M, --md5 compute the output's MD5 hash\n"); 686 685 printf(" -n, --network fuzz network input\n"); 686 printf(" -O, --max-output <n> kill children that output more than <n> bytes\n"); 687 687 printf(" -P, --protect <list> protect bytes and characters in <list>\n"); 688 688 printf(" -q, --quiet do not print children's messages\n"); … … 696 696 printf(" -v, --version output version information and exit\n"); 697 697 # else 698 printf(" -B <n> kill children that output more than <n> bytes\n");699 698 printf(" -c only fuzz files specified in the command line\n"); 700 699 printf(" -C <n> stop after <n> children have crashed (default 1)\n"); … … 706 705 printf(" -M compute the output's MD5 hash\n"); 707 706 printf(" -n fuzz network input\n"); 707 printf(" -O <n> kill children that output more than <n> bytes\n"); 708 708 printf(" -P <list> protect bytes and characters in <list>\n"); 709 709 printf(" -q do not print the fuzzed application's messages\n");
Note: See TracChangeset
for help on using the changeset viewer.