Ignore:
Timestamp:
Jul 6, 2007, 3:40:55 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Added -p flag to cherry pick file descriptors that get fuzzed.
File:
1 edited

Legend:

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

    r1762 r1791  
    158158#endif
    159159#define OPTSTR OPTSTR_REGEX OPTSTR_RLIMIT \
    160             "Ab:B:C:dD:f:F:imnP:qr:R:s:ST:vxhV"
     160            "Ab:B:C:dD:f:F:imnp:P:qr:R:s:ST:vxhV"
    161161#define MOREINFO "Try `%s --help' for more information.\n"
    162162        int option_index = 0;
     
    185185            { "max-memory",  1, NULL, 'M' },
    186186            { "network",     0, NULL, 'n' },
     187            { "pick",        1, NULL, 'p' },
    187188            { "protect",     1, NULL, 'P' },
    188189            { "quiet",       0, NULL, 'q' },
     
    275276            setenv("ZZUF_NETWORK", "1", 1);
    276277            break;
     278        case 'p': /* --pick */
     279            opts->pick = myoptarg;
     280            break;
    277281        case 'P': /* --protect */
    278282            opts->protect = myoptarg;
     
    376380    if(opts->bytes)
    377381        setenv("ZZUF_BYTES", opts->bytes, 1);
     382    if(opts->pick)
     383        setenv("ZZUF_PICK", opts->pick, 1);
    378384    if(opts->protect)
    379385        setenv("ZZUF_PROTECT", opts->protect, 1);
     
    428434    if(opts->bytes)
    429435        _zz_bytes(opts->bytes);
     436    if(opts->pick)
     437        _zz_pick(opts->pick);
    430438    if(opts->protect)
    431439        _zz_protect(opts->protect);
     
    10861094#endif
    10871095#if defined HAVE_REGEX_H
     1096    printf("              [-p descriptors] [-I include] [-E exclude]\n");
     1097    printf("              [PROGRAM [--] [ARGS]...]\n");
     1098#else
    10881099    printf("              [-I include] [-E exclude] [PROGRAM [--] [ARGS]...]\n");
    1089 #else
    1090     printf("              [PROGRAM [--] [ARGS]...]\n");
    10911100#endif
    10921101    printf("       zzuf -h | --help\n");
     
    11181127#endif
    11191128    printf("  -n, --network             fuzz network input\n");
     1129    printf("  -p, --pick <list>         only fuzz Nth descriptor with N in <list>\n");
    11201130    printf("  -P, --protect <list>      protect bytes and characters in <list>\n");
    11211131    printf("  -q, --quiet               do not print children's messages\n");
Note: See TracChangeset for help on using the changeset viewer.