Changeset 4239 for zzuf


Ignore:
Timestamp:
Jan 8, 2010, 1:48:27 AM (10 years ago)
Author:
Sam Hocevar
Message:

Deprecate --deny <list> in favour of --allow !<list>.

Location:
zzuf/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/opts.c

    r4112 r4239  
    11/*
    22 *  zzuf - general purpose fuzzer
    3  *  Copyright (c) 2002, 2007-2009 Sam Hocevar <sam@hocevar.net>
     3 *  Copyright (c) 2002, 2007-2010 Sam Hocevar <sam@hocevar.net>
    44 *                All Rights Reserved
    55 *
     
    3535{
    3636    opts->fuzzing = opts->bytes = opts->list = opts->ports = NULL;
    37     opts->allow = opts->deny = NULL;
     37    opts->allow = NULL;
    3838    opts->protect = opts->refuse = NULL;
    3939    opts->seed = DEFAULT_SEED;
  • zzuf/trunk/src/opts.h

    r3635 r4239  
    11/*
    22 *  zzuf - general purpose fuzzer
    3  *  Copyright (c) 2002, 2007-2009 Sam Hocevar <sam@hocevar.net>
     3 *  Copyright (c) 2002, 2007-2010 Sam Hocevar <sam@hocevar.net>
    44 *                All Rights Reserved
    55 *
     
    2121    char **oldargv;
    2222    char **newargv;
    23     char *fuzzing, *bytes, *list, *ports, *protect, *refuse, *allow, *deny;
     23    char *fuzzing, *bytes, *list, *ports, *protect, *refuse, *allow;
    2424    uint32_t seed;
    2525    uint32_t endseed;
  • zzuf/trunk/src/zzuf.c

    r4122 r4239  
    11/*
    22 *  zzuf - general purpose fuzzer
    3  *  Copyright (c) 2002, 2007-2009 Sam Hocevar <sam@hocevar.net>
     3 *  Copyright (c) 2002, 2007-2010 Sam Hocevar <sam@hocevar.net>
    44 *                All Rights Reserved
    55 *
     
    177177            { "debug",       0, NULL, 'd' },
    178178            { "delay",       1, NULL, 'D' },
    179             { "deny",        1, NULL, 'e' },
    180179#if defined HAVE_REGEX_H
    181180            { "exclude",     1, NULL, 'E' },
     
    247246            opts->delay = (int64_t)(atof(myoptarg) * 1000000.0);
    248247            break;
    249         case 'e': /* --deny */
    250             opts->deny = myoptarg;
    251             break;
    252248#if defined HAVE_REGEX_H
    253249        case 'E': /* --exclude */
     
    389385    }
    390386
    391     if (opts->deny && !network)
    392     {
    393         fprintf(stderr, "%s: deny option (-e) requires network fuzzing (-n)\n",
    394                 argv[0]);
    395         printf(MOREINFO, argv[0]);
    396         _zz_opts_fini(opts);
    397         return EXIT_FAILURE;
    398     }
    399 
    400387    _zz_setratio(opts->minratio, opts->maxratio);
    401388    _zz_setseed(opts->seed);
     
    459446    if(opts->ports)
    460447        setenv("ZZUF_PORTS", opts->ports, 1);
    461     if(opts->allow)
     448    if(opts->allow && opts->allow[0] == '!')
     449        setenv("ZZUF_DENY", opts->allow, 1);
     450    else if(opts->allow)
    462451        setenv("ZZUF_ALLOW", opts->allow, 1);
    463     if(opts->deny)
    464         setenv("ZZUF_DENY", opts->deny, 1);
    465452    if(opts->protect)
    466453        setenv("ZZUF_PROTECT", opts->protect, 1);
     
    941928    printf("Usage: zzuf [-AdimnqSvx] [-s seed|-s start:stop] [-r ratio|-r min:max]\n");
    942929#endif
    943     printf("              [-f fuzzing] [-D delay] [-j jobs] [-C crashes] [-B bytes]\n");
    944     printf("              [-t seconds] ");
     930    printf("              [-f mode] [-D delay] [-j jobs] [-C crashes] [-B bytes] [-a list]\n");
     931    printf("              [-t seconds]");
    945932#if defined HAVE_SETRLIMIT && defined ZZUF_RLIMIT_CPU
    946     printf(                           "[-T seconds] ");
     933    printf(                          " [-T seconds]");
    947934#endif
    948935#if defined HAVE_SETRLIMIT && defined ZZUF_RLIMIT_MEM
    949     printf(                                        "[-M mebibytes] ");
    950 #endif
    951     printf(                                                       "[-b ranges] [-p ports]\n");
     936    printf(                                       " [-M mebibytes]");
     937#endif
     938    printf(                                                      " [-b ranges] [-p ports]\n");
    952939    printf("              [-P protect] [-R refuse] [-l list]");
    953940#if defined HAVE_REGEX_H
     
    962949    printf("Mandatory arguments to long options are mandatory for short options too.\n");
    963950    printf("  -a, --allow <list>        only fuzz network input for IPs in <list>\n");
     951    printf("          ... !<list>       do not fuzz network input for IPs in <list>\n");
    964952    printf("  -A, --autoinc             increment seed each time a new file is opened\n");
    965953    printf("  -b, --bytes <ranges>      only fuzz bytes at offsets within <ranges>\n");
     
    969957#endif
    970958    printf("  -C, --max-crashes <n>     stop after <n> children have crashed (default 1)\n");
    971     printf("  -d, --debug               print debug messages\n");
     959    printf("  -d, --debug               print debug messages (twice for more verbosity)\n");
    972960    printf("  -D, --delay               delay between forks\n");
    973     printf("  -e, --deny <list>         do not fuzz network input for IPs in <list>\n");
    974961#if defined HAVE_REGEX_H
    975962    printf("  -E, --exclude <regex>     do not fuzz files matching <regex>\n");
     
    991978    printf("  -q, --quiet               do not print children's messages\n");
    992979    printf("  -r, --ratio <ratio>       bit fuzzing ratio (default %g)\n", DEFAULT_RATIO);
    993     printf("      --ratio <start:stop>  specify a ratio range\n");
     980    printf("          ... <start:stop>  specify a ratio range\n");
    994981    printf("  -R, --refuse <list>       refuse bytes and characters in <list>\n");
    995982    printf("  -s, --seed <seed>         random seed (default %i)\n", DEFAULT_SEED);
    996     printf("      --seed <start:stop>   specify a seed range\n");
     983    printf("         ... <start:stop>   specify a seed range\n");
    997984    printf("  -S, --signal              prevent children from diverting crashing signals\n");
    998985    printf("  -t, --max-time <n>        kill children that run for more than <n> seconds\n");
Note: See TracChangeset for help on using the changeset viewer.